Class: Hitblocks::Error
- Inherits:
-
Object
- Object
- Hitblocks::Error
- Defined in:
- lib/hitblocks/error.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(params) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(params) ⇒ Error
Returns a new instance of Error.
7 8 9 10 11 12 13 14 |
# File 'lib/hitblocks/error.rb', line 7 def initialize(params) @error = params[:error] @status = params[:status] if @error.match /Invalid Token/ raise Hitblocks::APIKeyIncorrect, "Your API key is incorrect. Please double check and set the value with Hitblocks.api_key = 'YOUR-API-KEY-HERE'" end end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
5 6 7 |
# File 'lib/hitblocks/error.rb', line 5 def error @error end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/hitblocks/error.rb', line 5 def status @status end |