Exception: Stockboy::TranslationError
- Inherits:
-
StandardError
- Object
- StandardError
- Stockboy::TranslationError
- Defined in:
- lib/stockboy/exceptions.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(key, record) ⇒ TranslationError
constructor
A new instance of TranslationError.
- #message ⇒ Object
Constructor Details
#initialize(key, record) ⇒ TranslationError
Returns a new instance of TranslationError.
6 7 8 9 10 |
# File 'lib/stockboy/exceptions.rb', line 6 def initialize (key, record) @key = key @record = record @cause = $! end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
21 22 23 |
# File 'lib/stockboy/exceptions.rb', line 21 def key @key end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
22 23 24 |
# File 'lib/stockboy/exceptions.rb', line 22 def record @record end |
Instance Method Details
#backtrace ⇒ Object
17 18 19 |
# File 'lib/stockboy/exceptions.rb', line 17 def backtrace @cause && @cause.backtrace || super end |
#message ⇒ Object
12 13 14 15 |
# File 'lib/stockboy/exceptions.rb', line 12 def reason = @cause && @cause. || super "Attribute [#{key}] caused #{reason}" end |