Class: HashMap::JSONAdapter

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

Defined Under Namespace

Classes: InvalidJOSN

Class Method Summary collapse

Class Method Details

.call(string) ⇒ Object



4
5
6
7
8
# File 'lib/hash_map/json_adapter.rb', line 4

def self.call(string)
  JSON[string]
rescue JSON::ParserError
  fail InvalidJOSN, "[HashMap Error] using: `map` with invalid JSON, please check your json before mapping"
end