Class: Hitblocks::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#errorObject (readonly)

Returns the value of attribute error.



5
6
7
# File 'lib/hitblocks/error.rb', line 5

def error
  @error
end

#statusObject (readonly)

Returns the value of attribute status.



5
6
7
# File 'lib/hitblocks/error.rb', line 5

def status
  @status
end