Method: Arpie::ShellwordsProtocol#to

Defined in:
lib/arpie/protocol.rb

#to(object) {|Shellwords.join(object.map {|x| x.to_s })| ... } ⇒ Object

Yields:

  • (Shellwords.join(object.map {|x| x.to_s }))

Raises:

  • (ArgumentError)


314
315
316
317
318
# File 'lib/arpie/protocol.rb', line 314

def to object
  raise ArgumentError, "#{self.class.to_s} can only encode arrays." unless
    object.is_a?(Array)
  yield Shellwords.join(object.map {|x| x.to_s })
end