Exception: PigeonFu::Unauthorized

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

Overview

:nodoc:

Constant Summary collapse

ErrorMessage =
'Unauthorized'

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Unauthorized

Returns a new instance of Unauthorized.



12
13
14
15
# File 'lib/pigeon_fu/exceptions.rb', line 12

def initialize(response)
  @error_code = response[:number]
  @error_desc = response[:error_description]
end

Instance Method Details

#messageObject



17
18
19
# File 'lib/pigeon_fu/exceptions.rb', line 17

def message
  "Error code #{@error_code}, #{@error_desc}."
end

#to_sObject



21
22
23
# File 'lib/pigeon_fu/exceptions.rb', line 21

def to_s
  message
end