Module: S3lite::Parse

Defined in:
lib/s3lite/parse.rb

Class Method Summary collapse

Class Method Details

.json(txt) ⇒ Object



3
4
5
6
7
8
# File 'lib/s3lite/parse.rb', line 3

def json(txt)
  case txt.class.to_s
  when 'String' then JSON.parse(txt, symbolize_names: true)
  when 'Hash', 'Array' then json(txt.to_json)
  end
end