Class: Operations::Task::Plan::InteractionHandler
- Inherits:
-
Object
- Object
- Operations::Task::Plan::InteractionHandler
- Defined in:
- app/models/operations/task/plan/interaction_handler.rb
Instance Attribute Summary collapse
-
#legal_states ⇒ Object
readonly
Returns the value of attribute legal_states.
Instance Method Summary collapse
-
#initialize(name, klass, &implementation) ⇒ InteractionHandler
constructor
A new instance of InteractionHandler.
- #when(*legal_states) ⇒ Object
Constructor Details
#initialize(name, klass, &implementation) ⇒ InteractionHandler
Returns a new instance of InteractionHandler.
2 3 4 5 |
# File 'app/models/operations/task/plan/interaction_handler.rb', line 2 def initialize name, klass, &implementation @legal_states = [] build_method_on klass, name, self, implementation end |
Instance Attribute Details
#legal_states ⇒ Object (readonly)
Returns the value of attribute legal_states.
6 7 8 |
# File 'app/models/operations/task/plan/interaction_handler.rb', line 6 def legal_states @legal_states end |
Instance Method Details
#when(*legal_states) ⇒ Object
8 9 10 |
# File 'app/models/operations/task/plan/interaction_handler.rb', line 8 def when *legal_states @legal_states = legal_states.map(&:to_s).freeze end |