Class: Roby::Interface::V2::Async::UIConnector::SetArgumentCommand
- Inherits:
-
ActionConnector
- Object
- Struct
- ActionConnector
- Roby::Interface::V2::Async::UIConnector::SetArgumentCommand
- Defined in:
- lib/roby/interface/v2/async/ui_connector.rb
Instance Attribute Summary collapse
-
#argument_name ⇒ Object
readonly
Returns the value of attribute argument_name.
Attributes inherited from ActionConnector
Instance Method Summary collapse
-
#initialize(connector, action, argument_name, getter: nil) ⇒ SetArgumentCommand
constructor
A new instance of SetArgumentCommand.
- #run(arg) ⇒ Object
Methods inherited from ActionConnector
Constructor Details
#initialize(connector, action, argument_name, getter: nil) ⇒ SetArgumentCommand
Returns a new instance of SetArgumentCommand.
75 76 77 78 |
# File 'lib/roby/interface/v2/async/ui_connector.rb', line 75 def initialize(connector, action, argument_name, getter: nil) super(connector, action, getter: nil) @argument_name = argument_name.to_sym end |
Instance Attribute Details
#argument_name ⇒ Object (readonly)
Returns the value of attribute argument_name.
73 74 75 |
# File 'lib/roby/interface/v2/async/ui_connector.rb', line 73 def argument_name @argument_name end |
Instance Method Details
#run(arg) ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/roby/interface/v2/async/ui_connector.rb', line 80 def run(arg) if getter = [:getter] arg = getter.call(arg) unless arg Interface.warn "not setting argument #{action}.#{argument_name}: getter returned nil" return end end action.arguments[argument_name] = arg if [:auto_apply] StartAction.new(connector, action, restart: true).run end end |