Class: Spatio::BlockType

Inherits:
Object
  • Object
show all
Defined in:
lib/spatio-sdk/models/block_type.rb

Constant Summary collapse

PARAGRAPH =
"paragraph".freeze
HEADING_1 =
"heading_1".freeze
HEADING_2 =
"heading_2".freeze
HEADING_3 =
"heading_3".freeze
BULLETED_LIST_ITEM =
"bulleted_list_item".freeze
NUMBERED_LIST_ITEM =
"numbered_list_item".freeze
TO_DO =
"to_do".freeze
TOGGLE =
"toggle".freeze
CODE =
"code".freeze
QUOTE =
"quote".freeze
CALLOUT =
"callout".freeze
DIVIDER =
"divider".freeze
IMAGE =
"image".freeze
VIDEO =
"video".freeze
FILE =
"file".freeze
EMBED =
"embed".freeze
TABLE =
"table".freeze
TABLE_ROW =
"table_row".freeze
COLUMN_LIST =
"column_list".freeze
COLUMN =
"column".freeze
EQUATION =
"equation".freeze
"breadcrumb".freeze
TABLE_OF_CONTENTS =
"table_of_contents".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



42
43
44
# File 'lib/spatio-sdk/models/block_type.rb', line 42

def self.all_vars
  @all_vars ||= [PARAGRAPH, HEADING_1, HEADING_2, HEADING_3, BULLETED_LIST_ITEM, NUMBERED_LIST_ITEM, TO_DO, TOGGLE, CODE, QUOTE, CALLOUT, DIVIDER, IMAGE, VIDEO, FILE, EMBED, TABLE, TABLE_ROW, COLUMN_LIST, COLUMN, EQUATION, BREADCRUMB, TABLE_OF_CONTENTS].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



49
50
51
# File 'lib/spatio-sdk/models/block_type.rb', line 49

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



56
57
58
59
# File 'lib/spatio-sdk/models/block_type.rb', line 56

def build_from_hash(value)
  return value if BlockType.all_vars.include?(value)
  raise "Invalid ENUM value #{value} for class #BlockType"
end