Exception: Epics::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Epics::Error
- Defined in:
- lib/epics/error.rb
Direct Known Subclasses
Defined Under Namespace
Classes: BusinessError, TechnicalError
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code) ⇒ Error
constructor
A new instance of Error.
- #short_text ⇒ Object
- #symbol ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(code) ⇒ Error
Returns a new instance of Error.
9 10 11 12 |
# File 'lib/epics/error.rb', line 9 def initialize(code) @code = code @error = self.class::ERRORS.fetch(code, {}) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/epics/error.rb', line 3 def code @code end |
Instance Method Details
#short_text ⇒ Object
18 19 20 |
# File 'lib/epics/error.rb', line 18 def short_text @error.fetch("short_text", "unknown") end |
#symbol ⇒ Object
14 15 16 |
# File 'lib/epics/error.rb', line 14 def symbol @error.fetch("symbol", "EPICS_UNKNOWN") end |
#to_s ⇒ Object
5 6 7 |
# File 'lib/epics/error.rb', line 5 def to_s [@error.fetch("symbol", "EPICS_UNKNOWN"), @error.fetch("short_text", "unknown")].join(" - ") end |