Class: Chordpro::Line

Inherits:
Struct
  • Object
show all
Includes:
Enumerable
Defined in:
lib/chordpro/line.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#partsObject

Returns the value of attribute parts

Returns:

  • (Object)

    the current value of parts



2
3
4
# File 'lib/chordpro/line.rb', line 2

def parts
  @parts
end

Instance Method Details

#accept(visitor) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/chordpro/line.rb', line 9

def accept(visitor)
  parts = map { |part| part.accept(visitor) }
  if visitor.respond_to?(:line)
    visitor.line(self, parts)
  else
    Line.new(parts)
  end
end

#each(&block) ⇒ Object



5
6
7
# File 'lib/chordpro/line.rb', line 5

def each(&block)
  parts.each(&block)
end