Module: Neo4j::Shared::Callbacks
- Extended by:
- ActiveSupport::Concern
- Included in:
- ActiveNode::Callbacks, ActiveRel::Callbacks
- Defined in:
- lib/neo4j/shared/callbacks.rb
Overview
:nodoc:
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#conditional_callback(kind, guard) ⇒ Object
Allows you to perform a callback if a condition is not satisfied.
-
#destroy ⇒ Object
:nodoc:.
- #initialize(args = nil) ⇒ Object
-
#touch ⇒ Object
:nodoc:.
Methods included from ActiveSupport::Concern
Instance Method Details
#conditional_callback(kind, guard) ⇒ Object
Allows you to perform a callback if a condition is not satisfied.
40 41 42 43 |
# File 'lib/neo4j/shared/callbacks.rb', line 40 def conditional_callback(kind, guard) return yield if guard run_callbacks(kind) { yield } end |
#destroy ⇒ Object
:nodoc:
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/neo4j/shared/callbacks.rb', line 21 def destroy #:nodoc: tx = Neo4j::Transaction.new run_callbacks(:destroy) { super } rescue @_deleted = false @attributes = @attributes.dup tx.mark_failed raise ensure tx.close if tx end |
#initialize(args = nil) ⇒ Object
17 18 19 |
# File 'lib/neo4j/shared/callbacks.rb', line 17 def initialize(args = nil) run_callbacks(:initialize) { super } end |
#touch ⇒ Object
:nodoc:
33 34 35 |
# File 'lib/neo4j/shared/callbacks.rb', line 33 def touch #:nodoc: run_callbacks(:touch) { super } end |