Module: WorkflowTemplate::State::Abstract
- Included in:
- Final, Intermediate
- Defined in:
- lib/workflow_template/state/abstract.rb
Instance Attribute Summary collapse
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#wrapped_state ⇒ Object
readonly
Returns the value of attribute wrapped_state.
Instance Method Summary collapse
- #bare_state ⇒ Object
- #error ⇒ Object
- #error? ⇒ Boolean
- #initialize(wrapped_state, meta) ⇒ Object
- #state_class ⇒ Object
Instance Attribute Details
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
8 9 10 |
# File 'lib/workflow_template/state/abstract.rb', line 8 def @meta end |
#wrapped_state ⇒ Object (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_state ⇒ Object
16 17 18 |
# File 'lib/workflow_template/state/abstract.rb', line 16 def state_class.unwrap_success(wrapped_state) end |
#error ⇒ Object
24 25 26 |
# File 'lib/workflow_template/state/abstract.rb', line 24 def error state_class.unwrap_error(wrapped_state) end |
#error? ⇒ 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, ) @wrapped_state = wrapped_state.freeze @meta = .freeze freeze end |
#state_class ⇒ Object
28 29 30 |
# File 'lib/workflow_template/state/abstract.rb', line 28 def state_class raise NotImplementedError, "#{self.class.name}##{__method__} unimplemented" end |