Class: BuckyBox::API::Response

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/buckybox/api.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Response

Returns a new instance of Response.



20
21
22
23
24
25
26
27
28
# File 'lib/buckybox/api.rb', line 20

def initialize(hash)
  unless hash.is_a?(Hash)
    raise ArgumentError, "#{hash.inspect} must be a Hash"
  end

  super(hash, nil) do |object, key|
    raise NoMethodError, "undefined method `#{key}' for #{object}"
  end
end