Class: NotionRb::Operations::ListAfter

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

Constant Summary collapse

COMMAND_TYPE =
:list_after
OPERATION_NAME =
:list_after
DEFAULT_TABLE =
'block'
DEFAULT_PATH =
['content']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, list_after_id, opts = {}) ⇒ ListAfter

Returns a new instance of ListAfter.



13
14
15
16
17
18
# File 'lib/notion_rb/operations/list_after.rb', line 13

def initialize(id, list_after_id, opts={})
  @id = id
  @list_after_id = list_after_id
  @table = opts.fetch(:table, DEFAULT_TABLE)
  @path = opts.fetch(:path, DEFAULT_PATH)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#list_after_idObject (readonly)

Returns the value of attribute list_after_id.



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

def list_after_id
  @list_after_id
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

#tableObject (readonly)

Returns the value of attribute table.



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

def table
  @table
end

Instance Method Details

#argsObject



32
33
34
35
36
# File 'lib/notion_rb/operations/list_after.rb', line 32

def args
  {
    id: list_after_id
  }
end

#commandsObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/notion_rb/operations/list_after.rb', line 20

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