Exception: Stocks::RetrievalError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/stocks/errors.rb

Overview

An error raised when data retrieval fails

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbol) ⇒ RetrievalError

Returns a new instance of RetrievalError.



7
8
9
# File 'lib/stocks/errors.rb', line 7

def initialize(symbol)
  super(self.class.message(symbol))
end

Class Method Details

.message(symbol) ⇒ Object

Generates the error message that is to be displayed.

Args
  • symbol The symbol to insert into the error message

Returns

An error message representing the error



17
18
19
# File 'lib/stocks/errors.rb', line 17

def self.message(symbol)
  ERROR_MESSAGE % symbol
end