Exception: Cli_Yo::Yo_Error
- Inherits:
-
Exception
- Object
- Exception
- Cli_Yo::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.
5 6 7 8 |
# File 'lib/cli_yo/yo_error.rb', line 5 def initialize error , code = nil @error = error @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/cli_yo/yo_error.rb', line 3 def code @code end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
3 4 5 |
# File 'lib/cli_yo/yo_error.rb', line 3 def error @error end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/cli_yo/yo_error.rb', line 10 def to_s if @code "Error code #{@code} => #{@error}" else @error end end |