Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/rosar.rb

Instance Method Summary collapse

Instance Method Details

#to_rObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rosar.rb', line 21

def to_r
  str = []
  self.each_pair do |k,v|
    case v
    when String
      str << "#{k}=#{v}"
    when Array
      str << "#{k}=#{v.to_r}"
    else
      str << "#{k}=#{v}"
    end
  end
  str * ", "
end