Exception: Tzu::Failure
- Inherits:
-
StandardError
- Object
- StandardError
- Tzu::Failure
- Defined in:
- lib/tzu/failure.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(type = nil, errors = nil) ⇒ Failure
constructor
A new instance of Failure.
- #message ⇒ Object
Constructor Details
#initialize(type = nil, errors = nil) ⇒ Failure
Returns a new instance of Failure.
5 6 7 8 |
# File 'lib/tzu/failure.rb', line 5 def initialize(type = nil, errors = nil) @type = type @raw_errors = errors end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/tzu/failure.rb', line 3 def type @type end |
Instance Method Details
#errors ⇒ Object
10 11 12 |
# File 'lib/tzu/failure.rb', line 10 def errors string_error? ? { errors: @raw_errors } : @raw_errors end |
#message ⇒ Object
14 15 16 |
# File 'lib/tzu/failure.rb', line 14 def string_error? ? @raw_errors : @raw_errors.to_s end |