Exception: Battlenet::ApiException

Inherits:
Exception
  • Object
show all
Defined in:
lib/battlenet/exceptions/api_exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ApiException

Returns a new instance of ApiException.



5
6
7
8
9
# File 'lib/battlenet/exceptions/api_exception.rb', line 5

def initialize(response)
  @response = response
  @code     = response.code
  @reason   = response['reason'] || nil
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



3
4
5
# File 'lib/battlenet/exceptions/api_exception.rb', line 3

def code
  @code
end

#reasonObject

Returns the value of attribute reason.



3
4
5
# File 'lib/battlenet/exceptions/api_exception.rb', line 3

def reason
  @reason
end

#responseObject

Returns the value of attribute response.



3
4
5
# File 'lib/battlenet/exceptions/api_exception.rb', line 3

def response
  @response
end