Class: Cb::Responses::Errors

Inherits:
Object
  • Object
show all
Defined in:
lib/cb/responses/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_response_hash, raise_on_error = true) ⇒ Errors

Returns a new instance of Errors.



16
17
18
19
20
# File 'lib/cb/responses/errors.rb', line 16

def initialize(raw_response_hash, raise_on_error = true)
  @response     = raw_response_hash
  @should_raise = raise_on_error
  @parsed       = parsed_errors
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



51
52
53
# File 'lib/cb/responses/errors.rb', line 51

def method_missing(method, *args, &block)
  parsed.send(method, *args, &block)
end

Instance Attribute Details

#parsedObject (readonly)

Returns the value of attribute parsed.



14
15
16
# File 'lib/cb/responses/errors.rb', line 14

def parsed
  @parsed
end