Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/rcap/extensions/array.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean


12
13
14
# File 'lib/rcap/extensions/array.rb', line 12

def blank?
  empty?
end

#extract_options!Object


16
17
18
# File 'lib/rcap/extensions/array.rb', line 16

def extract_options!
  last.is_a?(Hash) ? pop : {}
end

#to_s_for_capString

Formats an array into a string suitable for a CAP message.

Examples:

[ "one", "two words", "three" ].to_s_for_cap # => "one \"two words\" three"

See Also:


8
9
10
# File 'lib/rcap/extensions/array.rb', line 8

def to_s_for_cap
  map { |element| element.to_s.for_cap_list }.join(' ')
end