Class: Fixtury::DefinitionExecutor

Inherits:
Object
  • Object
show all
Defined in:
lib/fixtury/definition_executor.rb

Overview

A container that manages the execution of a definition in the context of a store.

Defined Under Namespace

Classes: Output

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(store: nil, definition:) ⇒ DefinitionExecutor

Returns a new instance of DefinitionExecutor.



22
23
24
25
26
# File 'lib/fixtury/definition_executor.rb', line 22

def initialize(store: nil, definition:)
  @store = store
  @definition = definition
  @output = Output.new
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



20
21
22
# File 'lib/fixtury/definition_executor.rb', line 20

def definition
  @definition
end

#outputObject (readonly)

Returns the value of attribute output.



20
21
22
# File 'lib/fixtury/definition_executor.rb', line 20

def output
  @output
end

#storeObject (readonly)

Returns the value of attribute store.



20
21
22
# File 'lib/fixtury/definition_executor.rb', line 20

def store
  @store
end

Instance Method Details

#callObject



28
29
30
31
# File 'lib/fixtury/definition_executor.rb', line 28

def call
  run_definition
  output
end