Class: NotionRb::Operations::UpdateParent
- Inherits:
-
Object
- Object
- NotionRb::Operations::UpdateParent
- Defined in:
- lib/notion_rb/operations/update_parent.rb
Constant Summary collapse
- COMMAND_TYPE =
:update
- OPERATION_NAME =
:update_parent
- TABLE =
'block'
- DEFAULT_PARENT_TABLE =
TABLE
- DEFAULT_ALIVE_VALUE =
true
Instance Attribute Summary collapse
-
#alive ⇒ Object
readonly
Returns the value of attribute alive.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
-
#parent_table ⇒ Object
readonly
Returns the value of attribute parent_table.
Instance Method Summary collapse
- #args ⇒ Object
- #commands ⇒ Object
-
#initialize(id, parent_id, opts = {}) ⇒ UpdateParent
constructor
A new instance of UpdateParent.
Constructor Details
#initialize(id, parent_id, opts = {}) ⇒ UpdateParent
Returns a new instance of UpdateParent.
14 15 16 17 18 19 |
# File 'lib/notion_rb/operations/update_parent.rb', line 14 def initialize(id, parent_id, opts = {}) @id = id @parent_id = parent_id @parent_table = opts.fetch(:parent_table, DEFAULT_PARENT_TABLE) @alive = opts.fetch(:alive, DEFAULT_ALIVE_VALUE) end |
Instance Attribute Details
#alive ⇒ Object (readonly)
Returns the value of attribute alive.
12 13 14 |
# File 'lib/notion_rb/operations/update_parent.rb', line 12 def alive @alive end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/notion_rb/operations/update_parent.rb', line 12 def id @id end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
12 13 14 |
# File 'lib/notion_rb/operations/update_parent.rb', line 12 def parent_id @parent_id end |
#parent_table ⇒ Object (readonly)
Returns the value of attribute parent_table.
12 13 14 |
# File 'lib/notion_rb/operations/update_parent.rb', line 12 def parent_table @parent_table end |
Instance Method Details
#args ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/notion_rb/operations/update_parent.rb', line 32 def args { parent_id: parent_id, parent_table: parent_table, alive: alive } end |
#commands ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/notion_rb/operations/update_parent.rb', line 21 def commands [ Commands::Factory.build( COMMAND_TYPE, id, args: args, table: TABLE ) ] end |