Class: Boltless::StatementCollector
- Inherits:
-
Object
- Object
- Boltless::StatementCollector
- Defined in:
- lib/boltless/statement_collector.rb
Overview
A shallow interface object to collect multiple Cypher statements. We have an explicit different interface (#add
instead ot #run
) from a regular transaction to clarify that we just collect statements without running them directly. As a result no subsequent statement can access the results of a previous statement within this collection.
Effectively, we wrap just multiple statements for a single HTTP API/Cypher transaction API request.
Instance Attribute Summary collapse
-
#statements ⇒ Object
readonly
We allow to read our collected details.
Instance Method Summary collapse
-
#add(cypher, **args) ⇒ StatementCollector
Add a new statement to the collector.
-
#initialize ⇒ Boltless::StatementCollector
constructor
Setup a new statement collector instance.
Constructor Details
#initialize ⇒ Boltless::StatementCollector
Setup a new statement collector instance.
26 27 28 |
# File 'lib/boltless/statement_collector.rb', line 26 def initialize @statements = [] end |
Instance Attribute Details
#statements ⇒ Object (readonly)
We allow to read our collected details
16 17 18 |
# File 'lib/boltless/statement_collector.rb', line 16 def statements @statements end |
Instance Method Details
#add(cypher, **args) ⇒ StatementCollector
Add a new statement to the collector.
35 36 37 38 |
# File 'lib/boltless/statement_collector.rb', line 35 def add(cypher, **args) @statements << Request.statement_payload(cypher, **args) self end |