Class: Array

Inherits:
Object show all
Defined in:
lib/lorj/compat.rb

Overview

Redefine string representation of Array

Instance Method Summary collapse

Instance Method Details

#to_sObject



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/lorj/compat.rb', line 44

def to_s
  '[' + map do |a|
    if a.is_a?(String)
      "\"#{a}\""
    elsif a.is_a?(Symbol)
      ":#{a}"
    else
      a.to_s
    end
  end.join(', ') + ']'
end