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
Constructor Details
#initialize(component, message) ⇒ ComponentError
Returns a new instance of ComponentError.
6 7 8 9 |
# File 'lib/panda_motd/component_error.rb', line 6 def initialize(component, ) @component = component @message = end |
Instance Attribute Details
#component ⇒ Object (readonly)
Returns the value of attribute component.
4 5 6 |
# File 'lib/panda_motd/component_error.rb', line 4 def component @component end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/panda_motd/component_error.rb', line 4 def @message end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/panda_motd/component_error.rb', line 11 def to_s return "#{@component.name} error: ".red + @message.to_s end |