Exception: Errawr::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Errawr::Error
- Defined in:
- lib/errawr/error.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
-
#initialize(key = :unknown, context = {}) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(key = :unknown, context = {}) ⇒ Error
Returns a new instance of Error.
5 6 7 8 9 10 11 |
# File 'lib/errawr/error.rb', line 5 def initialize(key = :unknown, context = {}) @key = key @i18n = I18n.t('errawr.' + @key.to_s) process_context(context) (context) end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
3 4 5 |
# File 'lib/errawr/error.rb', line 3 def context @context end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
3 4 5 |
# File 'lib/errawr/error.rb', line 3 def key @key end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/errawr/error.rb', line 3 def @message end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
3 4 5 |
# File 'lib/errawr/error.rb', line 3 def @metadata end |