Class: NotionRb::Operations::SetBlockLastEditedTime

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

Direct Known Subclasses

SetBlockCreatedTime

Constant Summary collapse

COMMAND_TYPE =
:set
OPERATION_NAME =
:set_block_last_edited_time
DEFAULT_PATH =
['last_edited_time'].freeze
TABLE =
'block'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, time, opts = {}) ⇒ SetBlockLastEditedTime

Returns a new instance of SetBlockLastEditedTime.



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

def initialize(id, time, opts = {})
  @id = id
  @time = time
  @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/set_block_last_edited_time.rb', line 11

def id
  @id
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

#timeObject (readonly)

Returns the value of attribute time.



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

def time
  @time
end

Instance Method Details

#argsObject



31
32
33
# File 'lib/notion_rb/operations/set_block_last_edited_time.rb', line 31

def args
  time
end

#commandsObject



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

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