Class: Neography::Rest::NodeIndexes

Inherits:
Indexes
  • Object
show all
Extended by:
Paths
Includes:
Helpers
Defined in:
lib/neography/rest/node_indexes.rb

Instance Method Summary collapse

Methods included from Paths

add_path, build_path, encode

Methods included from Helpers

#get_id, #json_content_type

Methods inherited from Indexes

#add, #create, #create_auto, #find, #find_by_key_value, #find_by_query, #get, #list, #remove, #remove_by_id, #remove_by_key, #remove_by_value

Constructor Details

#initialize(connection) ⇒ NodeIndexes

Returns a new instance of NodeIndexes.



16
17
18
# File 'lib/neography/rest/node_indexes.rb', line 16

def initialize(connection)
  super(connection, :node)
end

Instance Method Details

#create_unique(index, key, value, properties = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/neography/rest/node_indexes.rb', line 20

def create_unique(index, key, value, properties = {})
  options = {
    :body => (
      { :properties => properties,
        :key => key,
        :value => value
      }
    ).to_json,
    :headers => json_content_type
  }
  @connection.post(unique_path(:index => index), options)
end