Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/rtp-connect/ruby_extensions.rb

Overview

Extension to the Array class. These facilitate the creation of RTPConnect strings from an array of values.

Instance Method Summary collapse

Instance Method Details

#encodeString

Encodes an RTPConnect string from an array of values. Each value in the array is wrapped with double quotes, before the values are joined with a comma separator.

Returns:

  • (String)

    a proper RTPConnect type CSV string



74
75
76
77
# File 'lib/rtp-connect/ruby_extensions.rb', line 74

def encode
  wrapped = self.collect{|value| value.wrap}
  return wrapped.join(',')
end