Class: Onlyoffice::DocsIntegrationSdk::DocumentEditor::Config::EditorConfig::Customization::Features

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: Spellcheck, TabBackground, TabStyle

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(roles: nil, spellcheck: nil, tab_background: nil, tab_style: nil) ⇒ void

Parameters:



# File ''

prop :roles, T.nilable(T::Boolean), name: "roles"
prop :spellcheck, T.nilable(T.any(Spellcheck, T::Boolean)), name: "spellcheck"
prop :tab_background, T.nilable(T.any(TabBackground, TabBackground::Mode)), name: "tabBackground"
prop :tab_style, T.nilable(T.any(TabStyle, TabStyle::Mode)), name: "tabStyle"

Instance Attribute Details

#roles ⇒ Boolean?

Returns:

  • (Boolean, nil)

Since:

  • 0.1.0



# File ''

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

#spellcheck ⇒ Spellcheck, ...

Returns:

Since:

  • 0.1.0



# File ''

prop :spellcheck, T.nilable(T.any(Spellcheck, T::Boolean)), name: "spellcheck"

#tab_background ⇒ TabBackground, ...

Returns:

Since:

  • 0.1.0



# File ''

prop :tab_background, T.nilable(T.any(TabBackground, TabBackground::Mode)), name: "tabBackground"

#tab_style ⇒ TabStyle, ...

Returns:

Since:

  • 0.1.0



# File ''

prop :tab_style, T.nilable(T.any(TabStyle, TabStyle::Mode)), name: "tabStyle"

Class Method Details

.from_hash(hash, strict = nil) ⇒ Features

Parameters:

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

Returns:

Since:

  • 0.1.0



557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/onlyoffice/docs_integration_sdk/document_editor/config.rb', line 557

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

  spellcheck_v = s.spellcheck
  if !spellcheck_v.nil? && !spellcheck_v.is_a?(TrueClass) && !spellcheck_v.is_a?(FalseClass)
    s.spellcheck = Spellcheck.from_hash(spellcheck_v, strict)
  end

  tab_background_v = T.cast(s.tab_background, T.nilable(T.any(T::Hash[T.untyped, T.untyped], String)))
  if !tab_background_v.nil? && tab_background_v.is_a?(String)
    s.tab_background = TabBackground::Mode.from_serialized(tab_background_v)
  elsif !tab_background_v.nil? && tab_background_v.is_a?(Hash)
    s.tab_background = TabBackground.from_hash(tab_background_v, strict)
  end

  tab_style_v = T.cast(s.tab_style, T.nilable(T.any(T::Hash[T.untyped, T.untyped], String)))
  if !tab_style_v.nil? && tab_style_v.is_a?(String)
    s.tab_style = TabStyle::Mode.from_serialized(tab_style_v)
  elsif !tab_style_v.nil? && tab_style_v.is_a?(Hash)
    s.tab_style = TabStyle.from_hash(tab_style_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



584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
# File 'lib/onlyoffice/docs_integration_sdk/document_editor/config.rb', line 584

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

  spellcheck_v = spellcheck
  if !spellcheck_v.nil? && !spellcheck_v.is_a?(TrueClass) && !spellcheck_v.is_a?(FalseClass)
    h[Features.props[:spellcheck][:name] || "spellcheck"] = spellcheck_v.serialize(strict)
  end

  tab_background_v = tab_background
  if !tab_background_v.nil? && tab_background_v.is_a?(TabBackground::Mode)
    h[Features.props[:tab_background][:name] || "tab_background"] = tab_background_v.serialize
  elsif !tab_background_v.nil? && tab_background_v.is_a?(TabBackground)
    h[Features.props[:tab_background][:name] || "tab_background"] = tab_background_v.serialize(strict)
  end

  tab_style_v = tab_style
  if !tab_style_v.nil? && tab_style_v.is_a?(TabStyle::Mode)
    h[Features.props[:tab_style][:name] || "tab_style"] = tab_style_v.serialize
  elsif !tab_style_v.nil? && tab_style_v.is_a?(TabStyle)
    h[Features.props[:tab_style][:name] || "tab_style"] = tab_style_v.serialize(strict)
  end

  h
end