Exception: Stockboy::TranslationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/stockboy/exceptions.rb

Overview

TranslationError is a wrapper to store the standard error as well as the key and record which caused it

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, record) ⇒ TranslationError



7
8
9
10
# File 'lib/stockboy/exceptions.rb', line 7

def initialize (key, record)
 @key = key
 @record = record
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



16
17
18
# File 'lib/stockboy/exceptions.rb', line 16

def key
  @key
end

#recordObject (readonly)

Returns the value of attribute record.



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

def record
  @record
end

Instance Method Details

#messageObject



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

def message
 "Attribute [#{key}] caused #{cause.message}"
end