Class: TelosLWCP::Command::Outgoing
- Inherits:
-
Object
- Object
- TelosLWCP::Command::Outgoing
- Defined in:
- lib/telos_lwcp/command.rb
Instance Method Summary collapse
- #arguments_str ⇒ Object
-
#initialize(command, object, arguments) ⇒ Outgoing
constructor
A new instance of Outgoing.
- #to_s ⇒ Object
Constructor Details
#initialize(command, object, arguments) ⇒ Outgoing
Returns a new instance of Outgoing.
4 5 6 7 8 |
# File 'lib/telos_lwcp/command.rb', line 4 def initialize(command, object, arguments) @command = command @object = object @arguments = arguments end |
Instance Method Details
#arguments_str ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/telos_lwcp/command.rb', line 14 def arguments_str @arguments.map do |argument, value| rv = case value when TrueClass 'TRUE' when FalseClass 'FALSE' when Integer value when String "\"#{value}\"" end "#{argument}=#{rv}" end.join(', ') end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/telos_lwcp/command.rb', line 10 def to_s "#{@command} #{@object} #{arguments_str}\n" end |