Exception: Supercamp::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/supercamp/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(criteria, response) ⇒ Error

Returns a new instance of Error.



9
10
11
12
13
14
# File 'lib/supercamp/error.rb', line 9

def initialize(criteria, response)
  @code     = response.options[:code]
  @api_code = response.options[:headers]["X-Mashery-Error-Code"]
  @criteria = criteria
  super(response.body)
end

Instance Attribute Details

#api_codeObject (readonly)

Returns the value of attribute api_code.



6
7
8
# File 'lib/supercamp/error.rb', line 6

def api_code
  @api_code
end

#codeObject (readonly)

Returns the value of attribute code.



5
6
7
# File 'lib/supercamp/error.rb', line 5

def code
  @code
end

#criteriaObject (readonly)

Returns the value of attribute criteria.



7
8
9
# File 'lib/supercamp/error.rb', line 7

def criteria
  @criteria
end