Class: EndState::Action
- Inherits:
-
Object
- Object
- EndState::Action
- Defined in:
- lib/end_state/action.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(object, state) ⇒ Action
constructor
A new instance of Action.
- #rollback ⇒ Object
Constructor Details
#initialize(object, state) ⇒ Action
Returns a new instance of Action.
5 6 7 8 |
# File 'lib/end_state/action.rb', line 5 def initialize(object, state) @object = object @state = state end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
3 4 5 |
# File 'lib/end_state/action.rb', line 3 def object @object end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
3 4 5 |
# File 'lib/end_state/action.rb', line 3 def state @state end |
Instance Method Details
#call ⇒ Object
10 11 12 13 |
# File 'lib/end_state/action.rb', line 10 def call object.state = object.class.store_states_as_strings ? state.to_s : state.to_sym true end |
#rollback ⇒ Object
15 16 17 |
# File 'lib/end_state/action.rb', line 15 def rollback call end |