Module: ActiveCypher::Model::ConnectionOwner
- Extended by:
- ActiveSupport::Concern
- Includes:
- Logging
- Included in:
- Base, Relationship
- Defined in:
- lib/active_cypher/model/connection_owner.rb
Overview
Mixin for anything that “owns” a connection (nodes, relationships, maybe graph‑level service objects later). 100 % framework‑agnostic.
Class Method Summary collapse
Instance Method Summary collapse
-
#adapter_class ⇒ Object
Instance method to access the adapter class.
-
#connection ⇒ Object
Instance method to access the connection dynamically.
Methods included from Logging
#log_bench, #log_debug, #log_error, #log_info, #log_warn, logger, #logger
Class Method Details
.db_key_for(mapping, role) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/active_cypher/model/connection_owner.rb', line 11 def self.db_key_for(mapping, role) return nil unless mapping.is_a?(Hash) value = mapping[role] value = mapping[:writing] if value.nil? resolve_db_value(value, mapping[:writing]) end |
Instance Method Details
#adapter_class ⇒ Object
Instance method to access the adapter class
108 109 110 |
# File 'lib/active_cypher/model/connection_owner.rb', line 108 def adapter_class self.class.adapter_class end |
#connection ⇒ Object
Instance method to access the connection dynamically
113 114 115 |
# File 'lib/active_cypher/model/connection_owner.rb', line 113 def connection self.class.connection end |