Class: Professionali::Mash

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/professionali/mash.rb

Class Method Summary collapse

Class Method Details

.from_json(json_string) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/professionali/mash.rb', line 6

def self.from_json(json_string)
  result_hash = ::MultiJson.decode(json_string)
  puts result_hash
  if result_hash.is_a?(Array)
    result_hash.map{ |e| new(e) }
  else
    new(result_hash)
  end
end