Class: Neography::Rest::RelationshipIndexes
Instance Method Summary collapse
- #create_unique(index, key, value, type, from, to) ⇒ Object
-
#initialize(connection) ⇒ RelationshipIndexes
constructor
A new instance of RelationshipIndexes.
Methods included from Paths
Methods included from Helpers
#get_id, #json_content_type, #parse_direction
Methods inherited from Indexes
#add, #create, #create_auto, #drop, #find, #find_by_key_value, #find_by_query, #get, #list, #remove, #remove_by_id, #remove_by_key, #remove_by_value
Constructor Details
#initialize(connection) ⇒ RelationshipIndexes
Returns a new instance of RelationshipIndexes.
16 17 18 |
# File 'lib/neography/rest/relationship_indexes.rb', line 16 def initialize(connection) super(connection, :relationship) end |
Instance Method Details
#create_unique(index, key, value, type, from, to) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/neography/rest/relationship_indexes.rb', line 20 def create_unique(index, key, value, type, from, to) body = { :key => key, :value => value, :type => type, :start => @connection.configuration + "/node/#{get_id(from)}", :end => @connection.configuration + "/node/#{get_id(to)}" } = { :body => body.to_json, :headers => json_content_type } @connection.post(unique_path(:index => index), ) end |