Class: Hash

Inherits:
Object show all
Defined in:
lib/ron.rb

Instance Method Summary collapse

Instance Method Details

#to_ron_list(session) ⇒ Object



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/ron.rb', line 197

def to_ron_list session
  if self.class==Hash
    leader="{"
    trailer="}"
    sep="=>"
  else
    leader=self.class.name+"["
    trailer="]"
    sep=","
  end

  [leader]+map{|k,v| 
    Array(k.to_ron_list2(session)).push sep,
        v.to_ron_list2(session)<<', ' 
  }.flatten<<trailer
end