Module: Neo4j::ActiveNode
- Extended by:
- ActiveSupport::Concern
- Includes:
- Callbacks, Dependent, Enum, HasN, IdProperty, Initialize, Labels, Persistence, Property, Query, Reflection, Rels, Scope, Unpersisted, Validations, Shared, Shared::Identity, Shared::Marshal, Shared::PermittedAttributes, Shared::SerializedProperties
- Defined in:
- lib/neo4j/active_node.rb,
lib/neo4j/active_node/enum.rb,
lib/neo4j/active_node/rels.rb,
lib/neo4j/active_node/has_n.rb,
lib/neo4j/active_node/query.rb,
lib/neo4j/active_node/scope.rb,
lib/neo4j/active_node/labels.rb,
lib/neo4j/active_node/property.rb,
lib/neo4j/active_node/callbacks.rb,
lib/neo4j/active_node/dependent.rb,
lib/neo4j/active_node/reflection.rb,
lib/neo4j/active_node/id_property.rb,
lib/neo4j/active_node/orm_adapter.rb,
lib/neo4j/active_node/persistence.rb,
lib/neo4j/active_node/unpersisted.rb,
lib/neo4j/active_node/validations.rb,
lib/neo4j/active_node/query_methods.rb,
lib/neo4j/active_node/has_n/association.rb,
lib/neo4j/active_node/query/query_proxy.rb,
lib/neo4j/active_node/query/query_proxy_link.rb,
lib/neo4j/active_node/query/query_proxy_methods.rb,
lib/neo4j/active_node/query/query_proxy_enumerable.rb,
lib/neo4j/active_node/dependent/association_methods.rb,
lib/neo4j/active_node/dependent/query_proxy_methods.rb,
lib/neo4j/active_node/query/query_proxy_eager_loading.rb,
lib/neo4j/active_node/has_n/association_cypher_methods.rb,
lib/neo4j/active_node/query/query_proxy_find_in_batches.rb,
lib/neo4j/active_node/query/query_proxy_methods_of_mass_updating.rb
Overview
Makes Neo4j nodes and relationships behave like ActiveRecord objects. By including this module in your class it will create a mapping for the node to your ruby class by using a Neo4j Label with the same name as the class. When the node is loaded from the database it will check if there is a ruby class for the labels it has. If there Ruby class with the same name as the label then the Neo4j node will be wrapped in a new object of that class.
ClassMethods
-
Labels::ClassMethods defines methods like:
indexandfind -
Persistence::ClassMethods defines methods like:
createandcreate! -
Property::ClassMethods defines methods like:
property.
Defined Under Namespace
Modules: Callbacks, ClassMethods, Dependent, Enum, HasN, IdProperty, Initialize, Labels, Persistence, Property, Query, QueryMethods, Reflection, Rels, Scope, Unpersisted, Validations Classes: OrmAdapter
Constant Summary collapse
- MARSHAL_INSTANCE_VARIABLES =
[:@attributes, :@_persisted_obj, :@default_property_value]
Constants included from Labels
Labels::MODELS_FOR_LABELS_CACHE, Labels::WRAPPED_CLASSES
Constants included from Labels::Reloading
Labels::Reloading::MODELS_TO_RELOAD
Constants included from Shared::Attributes
Shared::Attributes::DEPRECATED_OBJECT_METHODS
Instance Attribute Summary
Attributes included from Dependent
Attributes included from Shared::Property
Attributes included from IdProperty::Accessor
Attributes included from Initialize
Instance Method Summary collapse
Methods included from ActiveSupport::Concern
Methods included from Shared::PermittedAttributes
#attributes=, #process_attributes
Methods included from Dependent
Methods included from HasN
#association_proxy, #association_proxy_cache, #association_proxy_cache_fetch, #association_proxy_hash, #association_query_proxy
Methods included from Unpersisted
#clear_deferred_nodes_for_association, #defer_create, #deferred_create_cache, #deferred_nodes_for_association, #pending_deferred_creations?
Methods included from Rels
Methods included from Labels
_wrapped_classes, #add_label, add_wrapped_class, clear_wrapped_models, #labels, model_for_labels, #remove_label
Methods included from Labels::Reloading
Methods included from Query
Methods included from Shared::Callbacks
#conditional_callback, #destroy, #touch
Methods included from Validations
Methods included from Shared::Validations
#read_attribute_for_validation, #save, #valid?
Methods included from Persistence
#_create_node, #concurrent_increment!, #create_model, #inject_primary_key!, #labels_for_create, #save, #save!
Methods included from Shared::Persistence
#apply_default_values, #cache_key, #concurrent_increment!, #create_or_update, #destroy, #destroyed?, #exist?, #freeze, #frozen?, #increment, #increment!, #new_record?, #persisted?, #props, #props_for_create, #props_for_persistence, #props_for_update, #reload, #reload_from_database, #touch, #update, #update!, #update_attribute, #update_attribute!, #update_model
Methods included from Shared::Property
#inject_defaults!, #inspect, #read_attribute, #reload_properties!, #send_props
Methods included from Shared::TypecastedAttributes
Methods included from Shared::Attributes
#==, #attributes, #query_attribute, #write_attribute
Methods included from Shared::MassAssignment
#assign_attributes, #attributes=
Methods included from Shared::SerializedProperties
#serializable_hash, #serialized_properties
Methods included from IdProperty::Accessor
#default_properties, #default_properties=, #default_property, #default_property_key
Methods included from Initialize
#init_on_load, #init_on_reload
Methods included from Shared::Initialize
Methods included from Shared::Marshal
Methods included from Shared::Identity
#==, #hash, #id, #neo_id, #to_key
Methods included from Shared
Instance Method Details
#initialize(args = nil) ⇒ Object
49 50 51 52 |
# File 'lib/neo4j/active_node.rb', line 49 def initialize(args = nil) args = sanitize_input_parameters(args) super(args) end |
#neo4j_obj ⇒ Object
54 55 56 |
# File 'lib/neo4j/active_node.rb', line 54 def neo4j_obj _persisted_obj || fail('Tried to access native neo4j object on a non persisted object') end |