Exception: BitlyrError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ BitlyrError

Returns a new instance of BitlyrError.



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

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.



2
3
4
# File 'lib/bitlyr/error.rb', line 2

def code
  @code
end

#responseObject (readonly)

Returns the value of attribute response.



2
3
4
# File 'lib/bitlyr/error.rb', line 2

def response
  @response
end