Class: Megingiard::ColorNode
- Inherits:
-
Object
- Object
- Megingiard::ColorNode
- Defined in:
- lib/megingiard/color_node.rb
Overview
A node that colors all its children in a given color
Instance Method Summary collapse
-
#initialize(color_name, child) ⇒ ColorNode
constructor
A new instance of ColorNode.
- #to_s ⇒ Object
Constructor Details
#initialize(color_name, child) ⇒ ColorNode
Returns a new instance of ColorNode.
8 9 10 11 |
# File 'lib/megingiard/color_node.rb', line 8 def initialize(color_name, child) @color_sequence = TextColorSequence.new(color_name) @child = child end |
Instance Method Details
#to_s ⇒ Object
13 14 15 |
# File 'lib/megingiard/color_node.rb', line 13 def to_s "#{@color_sequence}#{@child}#{RESET_SEQUENCE}" end |