Class: SuperDiff::Csi::ColorSequenceBlock
- Inherits:
-
Object
- Object
- SuperDiff::Csi::ColorSequenceBlock
- Includes:
- Enumerable
- Defined in:
- lib/super_diff/csi/color_sequence_block.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(colors = []) ⇒ ColorSequenceBlock
constructor
A new instance of ColorSequenceBlock.
- #push(color) ⇒ Object (also: #<<)
- #to_s ⇒ Object
Constructor Details
#initialize(colors = []) ⇒ ColorSequenceBlock
Returns a new instance of ColorSequenceBlock.
8 9 10 |
# File 'lib/super_diff/csi/color_sequence_block.rb', line 8 def initialize(colors = []) @colors = colors end |
Instance Method Details
#each(&block) ⇒ Object
12 13 14 |
# File 'lib/super_diff/csi/color_sequence_block.rb', line 12 def each(&block) colors.each(&block) end |
#push(color) ⇒ Object Also known as: <<
16 17 18 |
# File 'lib/super_diff/csi/color_sequence_block.rb', line 16 def push(color) colors.push(color) end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/super_diff/csi/color_sequence_block.rb', line 21 def to_s colors.map(&:to_s).join end |