Class: Operations::Task::Plan::InteractionHandler

Inherits:
Object
  • Object
show all
Defined in:
app/models/operations/task/plan/interaction_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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