module Neography::Rest::Constraints

Public Instance Methods

create_unique_constraint(label, property) click to toggle source
# File lib/neography/rest/constraints.rb, line 26
def create_unique_constraint(label, property)
  options = {
    :body => {
      :property_keys => [property]
    }.to_json,
    :headers => json_content_type
  }
  @connection.post("/schema/constraint/%{label}/uniqueness/" % {:label => label}, options)
end
drop_constraint(label, property) click to toggle source
# File lib/neography/rest/constraints.rb, line 6
def drop_constraint(label, property)
  @connection.delete("/schema/constraint/%{label}/uniqueness/%{property}" % {:label => label, :property => property})
end
get_constraints(label=nil) click to toggle source
# File lib/neography/rest/constraints.rb, line 10
def get_constraints(label=nil)
  #if label.nil?
  #  @connection.get(base_path)
  #else
    @connection.get("/schema/constraint/%{label}" % {:label => label})
  #end
end
get_unique_constraint(label, property) click to toggle source
# File lib/neography/rest/constraints.rb, line 22
def get_unique_constraint(label, property)
  @connection.get("/schema/constraint/%{label}/uniqueness/%{property}" % {:label => label, :property => property})
end
get_uniqueness(label) click to toggle source
# File lib/neography/rest/constraints.rb, line 18
def get_uniqueness(label)
  @connection.get("/schema/constraint/%{label}/uniqueness/" % {:label => label})
end