module Neo4j::Shared::DeclaredProperty::Index

None of these methods interact with the database. They only keep track of property settings in models. It could (should?) handle the actual indexing/constraining, but that's TBD.

Public Instance Methods

constraint!(type = :unique) click to toggle source
   # File lib/neo4j/shared/declared_property/index.rb
23 def constraint!(type = :unique)
24   fail Neo4j::InvalidPropertyOptionsError, "Can't set constraint on indexed property #{name} (constraints get indexes automatically)" if index?(:exact)
25   options[:constraint] = type
26 end
constraint?(type = :unique) click to toggle source
   # File lib/neo4j/shared/declared_property/index.rb
14 def constraint?(type = :unique)
15   options.key?(:constraint) && options[:constraint] == type
16 end
index!(type = :exact) click to toggle source
   # File lib/neo4j/shared/declared_property/index.rb
18 def index!(type = :exact)
19   fail Neo4j::InvalidPropertyOptionsError, "Can't set index on constrainted property #{name} (constraints get indexes automatically)" if constraint?(:unique)
20   options[:index] = type
21 end
index?(type = :exact) click to toggle source
   # File lib/neo4j/shared/declared_property/index.rb
10 def index?(type = :exact)
11   options.key?(:index) && options[:index] == type
12 end
index_or_constraint?() click to toggle source
  # File lib/neo4j/shared/declared_property/index.rb
6 def index_or_constraint?
7   index?(:exact) || constraint?(:unique)
8 end
unconstraint!(type = :unique) click to toggle source
   # File lib/neo4j/shared/declared_property/index.rb
32 def unconstraint!(type = :unique)
33   options.delete(:constraint) if constraint?(type)
34 end
unindex!(type = :exact) click to toggle source
   # File lib/neo4j/shared/declared_property/index.rb
28 def unindex!(type = :exact)
29   options.delete(:index) if index?(type)
30 end