Class: CypherBuilder::Node
- Inherits:
- BasicObject
- Defined in:
- lib/cypher_builder/node.rb
Instance Method Summary collapse
- #as_cypher(_ = nil) ⇒ Object
-
#initialize(prefix, labels: []) ⇒ Node
constructor
A new instance of Node.
- #method_missing(name, *_) ⇒ Object
- #respond_to_missing?(name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(prefix, labels: []) ⇒ Node
Returns a new instance of Node.
7 8 9 |
# File 'lib/cypher_builder/node.rb', line 7 def initialize(prefix, labels: []) @prefix, @labels = prefix, ::Kernel.Array(labels) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Method Details
#as_cypher(_ = nil) ⇒ Object
11 12 13 |
# File 'lib/cypher_builder/node.rb', line 11 def as_cypher(_ = nil) ::Kernel.sprintf('(%s)', [@prefix, *@labels].compact.join(':')) end |
#respond_to_missing?(name, include_private = false) ⇒ Boolean
15 16 17 |
# File 'lib/cypher_builder/node.rb', line 15 def respond_to_missing?(name, include_private = false) true end |