Class: Gloo::Exec::Action
- Inherits:
-
Object
- Object
- Gloo::Exec::Action
- Defined in:
- lib/gloo/exec/action.rb
Instance Attribute Summary collapse
-
#msg ⇒ Object
Returns the value of attribute msg.
-
#params ⇒ Object
Returns the value of attribute params.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
-
#dispatch ⇒ Object
Execute the action.
-
#display_value ⇒ Object
Generic function to get display value.
-
#initialize(msg, to, params = nil) ⇒ Action
constructor
Set up the action.
-
#valid? ⇒ Boolean
The action is valid if the object can receive the message specified.
Constructor Details
#initialize(msg, to, params = nil) ⇒ Action
Set up the action.
16 17 18 19 20 |
# File 'lib/gloo/exec/action.rb', line 16 def initialize( msg, to, params = nil ) @msg = msg @to = to @params = params end |
Instance Attribute Details
#msg ⇒ Object
Returns the value of attribute msg.
11 12 13 |
# File 'lib/gloo/exec/action.rb', line 11 def msg @msg end |
#params ⇒ Object
Returns the value of attribute params.
11 12 13 |
# File 'lib/gloo/exec/action.rb', line 11 def params @params end |
#to ⇒ Object
Returns the value of attribute to.
11 12 13 |
# File 'lib/gloo/exec/action.rb', line 11 def to @to end |
Instance Method Details
#dispatch ⇒ Object
Execute the action. Dispatch the message to the object.
34 35 36 |
# File 'lib/gloo/exec/action.rb', line 34 def dispatch @to. @msg, @params end |
#display_value ⇒ Object
Generic function to get display value. Can be used for debugging, etc.
42 43 44 |
# File 'lib/gloo/exec/action.rb', line 42 def display_value return "#{@msg} -> #{@to.pn}" end |
#valid? ⇒ Boolean
The action is valid if the object can receive the message specified.
26 27 28 |
# File 'lib/gloo/exec/action.rb', line 26 def valid? return @to.( @msg ) end |