Exception: Yo_Error
- Inherits:
-
Exception
- Object
- Exception
- Yo_Error
- Defined in:
- lib/cli_yo/yo_error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
-
#initialize(error, code = nil) ⇒ Yo_Error
constructor
A new instance of Yo_Error.
- #to_s ⇒ Object
Constructor Details
#initialize(error, code = nil) ⇒ Yo_Error
Returns a new instance of Yo_Error.
4 5 6 7 |
# File 'lib/cli_yo/yo_error.rb', line 4 def initialize error , code = nil @error = error @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
2 3 4 |
# File 'lib/cli_yo/yo_error.rb', line 2 def code @code end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
2 3 4 |
# File 'lib/cli_yo/yo_error.rb', line 2 def error @error end |
Instance Method Details
#to_s ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/cli_yo/yo_error.rb', line 9 def to_s if @code "Error code #{@code} => #{@error}" else @error end end |