Exception: BitlyOAuth::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Error

Returns a new instance of Error.



7
8
9
10
11
12
13
# File 'lib/bitly_oauth/error.rb', line 7

def initialize(response)
  @response = response
  @message  = response.reason
  @code     = response.status

  super("#{@message} - '#{@code}'")
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/bitly_oauth/error.rb', line 3

def code
  @code
end

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/bitly_oauth/error.rb', line 3

def response
  @response
end