Class: ComponentError
- Inherits:
-
Object
- Object
- ComponentError
- Defined in:
- lib/panda_motd/component_error.rb
Instance Attribute Summary collapse
-
#component ⇒ Object
readonly
Returns the value of attribute component.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(component, message) ⇒ ComponentError
constructor
A new instance of ComponentError.
-
#to_s ⇒ Object
Gets a printable error string in red.
Constructor Details
#initialize(component, message) ⇒ ComponentError
Returns a new instance of ComponentError.
8 9 10 11 |
# File 'lib/panda_motd/component_error.rb', line 8 def initialize(component, ) @component = component = end |
Instance Attribute Details
#component ⇒ Object (readonly)
Returns the value of attribute component.
6 7 8 |
# File 'lib/panda_motd/component_error.rb', line 6 def component @component end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
6 7 8 |
# File 'lib/panda_motd/component_error.rb', line 6 def end |
Instance Method Details
#to_s ⇒ Object
Gets a printable error string in red.
14 15 16 |
# File 'lib/panda_motd/component_error.rb', line 14 def to_s return "#{@component.name} error: ".red + .to_s end |