class TelosLWCP::Command::Outgoing

Public Class Methods

new(command, object, arguments) click to toggle source
# File lib/telos_lwcp/command.rb, line 4
def initialize(command, object, arguments)
  @command = command
  @object = object
  @arguments = arguments
end

Public Instance Methods

arguments_str() click to toggle source
# 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() click to toggle source
# File lib/telos_lwcp/command.rb, line 10
def to_s
  "#{@command} #{@object} #{arguments_str}\n"
end