Class: Onlyoffice::DocsIntegrationSdk::DocumentEditor::Config::EditorConfig::Customization::Layout::Toolbar

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/onlyoffice/docs_integration_sdk/document_editor/config.rb

Overview

Since:

  • 0.1.0

Defined Under Namespace

Classes: Collaboration, File, Home, View

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collaboration: nil, draw: nil, file: nil, home: nil, layout: nil, plugins: nil, protect: nil, references: nil, save: nil, view: nil) ⇒ void

Parameters:

  • collaboration (Collaboration, Boolean, nil) (defaults to: nil) —

    @since 0.1.0

  • draw (Boolean, nil) (defaults to: nil) —

    @since 0.1.0

  • file (File, Boolean, nil) (defaults to: nil) —

    @since 0.1.0

  • home (Home, nil) (defaults to: nil) —
  • layout (Boolean, nil) (defaults to: nil) —

    @since 0.1.0

  • plugins (Boolean, nil) (defaults to: nil) —

    @since 0.1.0

  • protect (Boolean, nil) (defaults to: nil) —

    @since 0.1.0

  • references (Boolean, nil) (defaults to: nil) —

    @since 0.1.0

  • save (Boolean, nil) (defaults to: nil) —

    @since 0.1.0

  • view (View, Boolean, nil) (defaults to: nil) —

    @since 0.1.0



# File ''

prop :collaboration, T.nilable(T.any(Collaboration, T::Boolean)), name: "collaboration"
prop :draw, T.nilable(T::Boolean), name: "draw"
prop :file, T.nilable(T.any(File, T::Boolean)), name: "file"
prop :home, T.nilable(Home), name: "home"
prop :layout, T.nilable(T::Boolean), name: "layout"
prop :plugins, T.nilable(T::Boolean), name: "plugins"
prop :protect, T.nilable(T::Boolean), name: "protect"
prop :references, T.nilable(T::Boolean), name: "references"
prop :save, T.nilable(T::Boolean), name: "save"
prop :view, T.nilable(T.any(View, T::Boolean)), name: "view"

Instance Attribute Details

#collaboration ⇒ Collaboration, ...

Returns:

Since:

  • 0.1.0



# File ''

prop :collaboration, T.nilable(T.any(Collaboration, T::Boolean)), name: "collaboration"

#draw ⇒ Boolean?

Returns:

  • (Boolean, nil)

Since:

  • 0.1.0



# File ''

prop :draw, T.nilable(T::Boolean), name: "draw"

#file ⇒ File, ...

Returns:

  • (File, Boolean, nil)

Since:

  • 0.1.0



# File ''

prop :file, T.nilable(T.any(File, T::Boolean)), name: "file"

#home ⇒ Home?

Returns:

Since:

  • 0.1.0



# File ''

prop :home, T.nilable(Home), name: "home"

#layout ⇒ Boolean?

Returns:

  • (Boolean, nil)

Since:

  • 0.1.0



# File ''

prop :layout, T.nilable(T::Boolean), name: "layout"

#plugins ⇒ Boolean?

Returns:

  • (Boolean, nil)

Since:

  • 0.1.0



# File ''

prop :plugins, T.nilable(T::Boolean), name: "plugins"

#protect ⇒ Boolean?

Returns:

  • (Boolean, nil)

Since:

  • 0.1.0



# File ''

prop :protect, T.nilable(T::Boolean), name: "protect"

#references ⇒ Boolean?

Returns:

  • (Boolean, nil)

Since:

  • 0.1.0



# File ''

prop :references, T.nilable(T::Boolean), name: "references"

#save ⇒ Boolean?

Returns:

  • (Boolean, nil)

Since:

  • 0.1.0



# File ''

prop :save, T.nilable(T::Boolean), name: "save"

#view ⇒ View, ...

Returns:

  • (View, Boolean, nil)

Since:

  • 0.1.0



# File ''

prop :view, T.nilable(T.any(View, T::Boolean)), name: "view"

Class Method Details

.from_hash(hash, strict = nil) ⇒ Toolbar

Parameters:

  • hash (T.untyped)
  • strict (T.untyped) (defaults to: nil)

Returns:

Since:

  • 0.1.0



856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
# File 'lib/onlyoffice/docs_integration_sdk/document_editor/config.rb', line 856

def self.from_hash(hash, strict = nil)
  s = T.cast(super(hash, strict), Toolbar)

  collaboration_v = s.collaboration
  if !collaboration_v.nil? && !collaboration_v.is_a?(TrueClass) && !collaboration_v.is_a?(FalseClass)
    s.collaboration = Collaboration.from_hash(collaboration_v, strict)
  end

  file_v = s.file
  if !file_v.nil? && !file_v.is_a?(TrueClass) && !file_v.is_a?(FalseClass)
    s.file = File.from_hash(file_v, strict)
  end

  view_v = s.view
  if !view_v.nil? && !view_v.is_a?(TrueClass) && !view_v.is_a?(FalseClass)
    s.view = View.from_hash(view_v, strict)
  end

  s
end

Instance Method Details

#serialize(strict = nil) ⇒ T.untyped

Parameters:

  • strict (T.untyped) (defaults to: nil)

Returns:

  • (T.untyped)

Since:

  • 0.1.0



879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
# File 'lib/onlyoffice/docs_integration_sdk/document_editor/config.rb', line 879

def serialize(strict = nil)
  h = T.cast(super(strict), T::Hash[T.untyped, T.untyped])

  collaboration_v = collaboration
  if !collaboration_v.nil? && !collaboration_v.is_a?(TrueClass) && !collaboration_v.is_a?(FalseClass)
    h[Toolbar.props[:collaboration][:name] || "collaboration"] = collaboration_v.serialize(strict)
  end

  file_v = file
  if !file_v.nil? && !file_v.is_a?(TrueClass) && !file_v.is_a?(FalseClass)
    h[Toolbar.props[:file][:name] || "file"] = file_v.serialize(strict)
  end

  view_v = view
  if !view_v.nil? && !view_v.is_a?(TrueClass) && !view_v.is_a?(FalseClass)
    h[Toolbar.props[:view][:name] || "view"] = view_v.serialize(strict)
  end

  h
end