lib/mambanation.rb in mambanation-0.1.19 vs lib/mambanation.rb in mambanation-0.1.20

- old
+ new

@@ -4,11 +4,10 @@ require "yajl" module MambaNation include HTTParty API_VERSION = "2".freeze - format :json class MambaNationError < StandardError attr_reader :data def initialize(data) @@ -68,24 +67,24 @@ raise InformMambaNation, "MambaNation had an internal error. Please let them know in the group. (#{response.code}): #{response.message}" when 502..503 raise Unavailable, "(#{response.code}): #{response.message}" end end - + def self.parse(response) Yajl::Parser.parse(response.body) end - + def self.mash(obj) if obj.is_a?(Array) obj.map{|item| make_mash_with_consistent_hash(item)} elsif obj.is_a?(Hash) make_mash_with_consistent_hash(obj) else obj end end - + # Lame workaround for the fact that mash doesn't hash correctly def self.make_mash_with_consistent_hash(obj) m = Hashie::Mash.new(obj) def m.hash inspect.hash