Class: String

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

Overview

Extension to String for deserializing JSON

Instance Method Summary collapse

Instance Method Details

#deserializeHash

Convert this String into a JSON Hash

Returns:

  • (Hash)

    Hash representing the given JSON

Raises:

  • (WeeseError)

    If JSON parse fails



14
15
16
17
18
# File 'lib/weese/deserialize.rb', line 14

def deserialize
  JSON.parse(self)
rescue JSON::ParserError => e
  raise WeeseError, e.to_s
end