Class: NotionRb::Operations::SetBlockType

Inherits:
Object
  • Object
show all
Defined in:
lib/notion_rb/operations/set_block_type.rb

Constant Summary collapse

DEFAULT_VERSION =
1
COMMAND_TYPE =
:set
OPERATION_NAME =
:set_block_type
TABLE =
'block'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, type) ⇒ SetBlockType

Returns a new instance of SetBlockType.



13
14
15
16
# File 'lib/notion_rb/operations/set_block_type.rb', line 13

def initialize(id, type)
  @id = id
  @type = type
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



11
12
13
# File 'lib/notion_rb/operations/set_block_type.rb', line 11

def id
  @id
end

#typeObject (readonly)

Returns the value of attribute type.



11
12
13
# File 'lib/notion_rb/operations/set_block_type.rb', line 11

def type
  @type
end

Instance Method Details

#argsObject



29
30
31
32
33
34
35
# File 'lib/notion_rb/operations/set_block_type.rb', line 29

def args
  {
    type: type,
    version: DEFAULT_VERSION,
    id: id
  }
end

#commandsObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/notion_rb/operations/set_block_type.rb', line 18

def commands
  [
    Commands::Factory.build(
      :set,
      id,
      args: args,
      table: TABLE
    )
  ]
end