Class: SuperDiff::Csi::ColorSequenceBlock

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/super_diff/csi/color_sequence_block.rb

Instance Method Summary collapse

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_sObject



21
22
23
# File 'lib/super_diff/csi/color_sequence_block.rb', line 21

def to_s
  colors.map(&:to_s).join
end