Module: WorkflowTemplate::State::Abstract

Included in:
Final, Intermediate
Defined in:
lib/workflow_template/state/abstract.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#metaObject (readonly)

Returns the value of attribute meta.



8
9
10
# File 'lib/workflow_template/state/abstract.rb', line 8

def meta
  @meta
end

#wrapped_stateObject (readonly)

Returns the value of attribute wrapped_state.



8
9
10
# File 'lib/workflow_template/state/abstract.rb', line 8

def wrapped_state
  @wrapped_state
end

Instance Method Details

#bare_stateObject



16
17
18
# File 'lib/workflow_template/state/abstract.rb', line 16

def bare_state
  state_class.unwrap_success(wrapped_state)
end

#errorObject



24
25
26
# File 'lib/workflow_template/state/abstract.rb', line 24

def error
  state_class.unwrap_error(wrapped_state)
end

#error?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/workflow_template/state/abstract.rb', line 20

def error?
  state_class.error?(wrapped_state)
end

#initialize(wrapped_state, meta) ⇒ Object



10
11
12
13
14
# File 'lib/workflow_template/state/abstract.rb', line 10

def initialize(wrapped_state, meta)
  @wrapped_state = wrapped_state.freeze
  @meta = meta.freeze
  freeze
end

#state_classObject

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/workflow_template/state/abstract.rb', line 28

def state_class
  raise NotImplementedError, "#{self.class.name}##{__method__} unimplemented"
end