Module: Neo4j::Core::Index::ClassMethods
- Included in:
- Node, Relationship
- Defined in:
- lib/neo4j-core/index/class_methods.rb
Instance Attribute Summary collapse
-
#_indexer ⇒ Object
readonly
The indexer which we are delegating to.
Instance Method Summary collapse
- #_config ⇒ Object
-
#add_index(*args, &block) ⇒ Object
Delegates the ‘add_index` message to @_indexer instance with the supplied parameters.
-
#find(*args, &block) ⇒ Object
Delegates the ‘find` message to @_indexer instance with the supplied parameters.
-
#has_index_type?(*args, &block) ⇒ Object
Delegates the ‘has_index_type?` message to @_indexer instance with the supplied parameters.
-
#index(*args, &block) ⇒ Object
Delegates the ‘index` message to @_indexer instance with the supplied parameters.
-
#index?(*args, &block) ⇒ Object
Delegates the ‘index?` message to @_indexer instance with the supplied parameters.
-
#index_for_type(*args, &block) ⇒ Object
Delegates the ‘index_for_type` message to @_indexer instance with the supplied parameters.
-
#index_name_for_type(*args, &block) ⇒ Object
Delegates the ‘index_name_for_type` message to @_indexer instance with the supplied parameters.
-
#index_type(*args, &block) ⇒ Object
Delegates the ‘index_type` message to @_indexer instance with the supplied parameters.
- #indexer(index_config) ⇒ Object
-
#node_indexer(config = _config || IndexConfig.new(:node)) { ... } ⇒ Neo4j::Core::Index::Indexer
Sets which indexer should be used for the given node class.
-
#put_if_absent(*args, &block) ⇒ Object
Delegates the ‘put_if_absent` message to @_indexer instance with the supplied parameters.
-
#rel_indexer(config = _config || IndexConfig.new(:rel), &config_dsl) ⇒ Neo4j::Core::Index::Indexer
Sets which indexer should be used for the given relationship class Same as #node_indexer except that it indexes relationships instead of nodes.
-
#rm_index(*args, &block) ⇒ Object
Delegates the ‘rm_index` message to @_indexer instance with the supplied parameters.
-
#rm_index_config(*args, &block) ⇒ Object
Delegates the ‘rm_index_config` message to @_indexer instance with the supplied parameters.
-
#rm_index_type(*args, &block) ⇒ Object
Delegates the ‘rm_index_type` message to @_indexer instance with the supplied parameters.
-
#trigger_on(hash) ⇒ Object
You can specify which nodes should be triggered.
Instance Attribute Details
#_indexer ⇒ Object (readonly)
The indexer which we are delegating to
7 8 9 |
# File 'lib/neo4j-core/index/class_methods.rb', line 7 def _indexer @_indexer end |
Instance Method Details
#_config ⇒ Object
48 49 50 |
# File 'lib/neo4j-core/index/class_methods.rb', line 48 def _config @_indexer && @_indexer.config end |
#add_index(*args, &block) ⇒ Object
Delegates the ‘add_index` message to @_indexer instance with the supplied parameters.
92 |
# File 'lib/neo4j-core/index/class_methods.rb', line 92 delegate :add_index |
#find(*args, &block) ⇒ Object
Delegates the ‘find` message to @_indexer instance with the supplied parameters.
87 |
# File 'lib/neo4j-core/index/class_methods.rb', line 87 delegate :find |
#has_index_type?(*args, &block) ⇒ Object
Delegates the ‘has_index_type?` message to @_indexer instance with the supplied parameters.
89 |
# File 'lib/neo4j-core/index/class_methods.rb', line 89 delegate :has_index_type? |
#index(*args, &block) ⇒ Object
Delegates the ‘index` message to @_indexer instance with the supplied parameters.
86 |
# File 'lib/neo4j-core/index/class_methods.rb', line 86 delegate :index |
#index?(*args, &block) ⇒ Object
Delegates the ‘index?` message to @_indexer instance with the supplied parameters.
88 |
# File 'lib/neo4j-core/index/class_methods.rb', line 88 delegate :index? |
#index_for_type(*args, &block) ⇒ Object
Delegates the ‘index_for_type` message to @_indexer instance with the supplied parameters.
96 |
# File 'lib/neo4j-core/index/class_methods.rb', line 96 delegate :index_for_type |
#index_name_for_type(*args, &block) ⇒ Object
Delegates the ‘index_name_for_type` message to @_indexer instance with the supplied parameters.
95 |
# File 'lib/neo4j-core/index/class_methods.rb', line 95 delegate :index_name_for_type |
#index_type(*args, &block) ⇒ Object
Delegates the ‘index_type` message to @_indexer instance with the supplied parameters.
94 |
# File 'lib/neo4j-core/index/class_methods.rb', line 94 delegate :index_type |
#indexer(index_config) ⇒ Object
52 53 54 |
# File 'lib/neo4j-core/index/class_methods.rb', line 52 def indexer(index_config) @_indexer ||= IndexerRegistry.instance.register(Indexer.new(index_config)) end |
#node_indexer(config = _config || IndexConfig.new(:node)) { ... } ⇒ Neo4j::Core::Index::Indexer
Sets which indexer should be used for the given node class. You can share an indexer between several different classes.
33 34 35 36 |
# File 'lib/neo4j-core/index/class_methods.rb', line 33 def node_indexer(config = _config || IndexConfig.new(:node), &config_dsl) config.instance_eval(&config_dsl) indexer(config) end |
#put_if_absent(*args, &block) ⇒ Object
Delegates the ‘put_if_absent` message to @_indexer instance with the supplied parameters.
97 |
# File 'lib/neo4j-core/index/class_methods.rb', line 97 delegate :put_if_absent |
#rel_indexer(config = _config || IndexConfig.new(:rel), &config_dsl) ⇒ Neo4j::Core::Index::Indexer
Sets which indexer should be used for the given relationship class Same as #node_indexer except that it indexes relationships instead of nodes.
43 44 45 46 |
# File 'lib/neo4j-core/index/class_methods.rb', line 43 def rel_indexer(config = _config || IndexConfig.new(:rel), &config_dsl) config.instance_eval(&config_dsl) indexer(config) end |
#rm_index(*args, &block) ⇒ Object
Delegates the ‘rm_index` message to @_indexer instance with the supplied parameters.
93 |
# File 'lib/neo4j-core/index/class_methods.rb', line 93 delegate :rm_index |
#rm_index_config(*args, &block) ⇒ Object
Delegates the ‘rm_index_config` message to @_indexer instance with the supplied parameters.
91 |
# File 'lib/neo4j-core/index/class_methods.rb', line 91 delegate :rm_index_config |
#rm_index_type(*args, &block) ⇒ Object
Delegates the ‘rm_index_type` message to @_indexer instance with the supplied parameters.
90 |
# File 'lib/neo4j-core/index/class_methods.rb', line 90 delegate :rm_index_type |
#trigger_on(hash) ⇒ Object
You can specify which nodes should be triggered. The index can be triggered by one or more properties having one or more values. This can also be done using the #node_indexer or #rel_indexer methods.
63 64 65 |
# File 'lib/neo4j-core/index/class_methods.rb', line 63 def trigger_on(hash) _config.trigger_on(hash) end |