Class: SmashTheState::Operation::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/smash_the_state/operation/step.rb

Direct Known Subclasses

ValidationStep

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(step_name, options = {}, &block) ⇒ Step

Returns a new instance of Step.



7
8
9
10
11
12
13
14
# File 'lib/smash_the_state/operation/step.rb', line 7

def initialize(step_name, options = {}, &block)
  @name           = step_name
  @implementation = block
  @options        = {
    # defaults
    side_effect_free: nil # nil roughly implies unknown
  }.merge(options)
end

Instance Attribute Details

#error_handlerObject

Returns the value of attribute error_handler.



4
5
6
# File 'lib/smash_the_state/operation/step.rb', line 4

def error_handler
  @error_handler
end

#implementationObject (readonly)

Returns the value of attribute implementation.



5
6
7
# File 'lib/smash_the_state/operation/step.rb', line 5

def implementation
  @implementation
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/smash_the_state/operation/step.rb', line 5

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/smash_the_state/operation/step.rb', line 5

def options
  @options
end

Instance Method Details

#side_effect_free?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/smash_the_state/operation/step.rb', line 16

def side_effect_free?
  options[:side_effect_free] == true
end