Class: NodeApiClient::Insert

Inherits:
Object
  • Object
show all
Defined in:
lib/dynalist/node_api_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent_node, node, index = 0) ⇒ Insert

Returns a new instance of Insert.



28
29
30
31
32
# File 'lib/dynalist/node_api_client.rb', line 28

def initialize(parent_node, node, index = 0)
  @parent_node = parent_node
  @node = node
  @index = index
end

Instance Method Details

#to_queryObject



34
35
36
37
38
39
40
# File 'lib/dynalist/node_api_client.rb', line 34

def to_query
  {
    action: "insert",
    parent_id: @parent_node.node_id,
    index: @index
  }.merge(@node.attributes)
end