Class: NodeApiClient::Insert
- Inherits:
-
Object
- Object
- NodeApiClient::Insert
- Defined in:
- lib/dynalist/node_api_client.rb
Instance Method Summary collapse
-
#initialize(parent_node, node, index = 0) ⇒ Insert
constructor
A new instance of Insert.
- #to_query ⇒ Object
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_query ⇒ Object
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 |