Class: Clef::Layout::SystemLayout

Inherits:
Object
  • Object
show all
Defined in:
lib/clef/layout/system_layout.rb

Defined Under Namespace

Classes: System

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(score, pages:, positions:, style:) ⇒ SystemLayout

Returns a new instance of SystemLayout.

Parameters:



28
29
30
31
32
33
# File 'lib/clef/layout/system_layout.rb', line 28

def initialize(score, pages:, positions:, style:)
  @score = score
  @pages = pages
  @positions = positions
  @style = style
end

Instance Attribute Details

#pagesObject (readonly)

Returns the value of attribute pages.



22
23
24
# File 'lib/clef/layout/system_layout.rb', line 22

def pages
  @pages
end

#positionsObject (readonly)

Returns the value of attribute positions.



22
23
24
# File 'lib/clef/layout/system_layout.rb', line 22

def positions
  @positions
end

#scoreObject (readonly)

Returns the value of attribute score.



22
23
24
# File 'lib/clef/layout/system_layout.rb', line 22

def score
  @score
end

#styleObject (readonly)

Returns the value of attribute style.



22
23
24
# File 'lib/clef/layout/system_layout.rb', line 22

def style
  @style
end

Instance Method Details

#buildArray<System>

Returns:



36
37
38
39
40
41
42
# File 'lib/clef/layout/system_layout.rb', line 36

def build
  pages.flat_map.with_index do |page, page_index|
    page.map.with_index do |line, line_index|
      build_system(line, page_index, line_index)
    end
  end
end