Class: CypherBuilder::Runner
- Inherits:
-
Object
- Object
- CypherBuilder::Runner
- Defined in:
- lib/cypher_builder/infra/runner.rb
Class Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #execute(**params) ⇒ Object
-
#initialize(adapter = Adapter::DEFAULT) ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize(adapter = Adapter::DEFAULT) ⇒ Runner
Returns a new instance of Runner.
13 14 15 |
# File 'lib/cypher_builder/infra/runner.rb', line 13 def initialize(adapter = Adapter::DEFAULT) @adapter = adapter end |
Class Attribute Details
Class Method Details
.exec(adapter = Adapter::DEFAULT, **params) ⇒ Object
7 8 9 |
# File 'lib/cypher_builder/infra/runner.rb', line 7 def exec(adapter = Adapter::DEFAULT, ** params) self.new(adapter).execute(** params) end |
Instance Method Details
#execute(**params) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/cypher_builder/infra/runner.rb', line 17 def execute(** params) payload = Payload.new(params) context = Context.new cypher = self.class.cypher.as_cypher(payload: payload, context: context) @adapter.execute(cypher, payload.necessary) end |