Class: Clef::Layout::SystemLayout
- Inherits:
-
Object
- Object
- Clef::Layout::SystemLayout
- Defined in:
- lib/clef/layout/system_layout.rb
Defined Under Namespace
Classes: System
Instance Attribute Summary collapse
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
-
#positions ⇒ Object
readonly
Returns the value of attribute positions.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
Instance Method Summary collapse
- #build ⇒ Array<System>
-
#initialize(score, pages:, positions:, style:) ⇒ SystemLayout
constructor
A new instance of SystemLayout.
Constructor Details
#initialize(score, pages:, positions:, style:) ⇒ SystemLayout
Returns a new instance of SystemLayout.
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
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
22 23 24 |
# File 'lib/clef/layout/system_layout.rb', line 22 def pages @pages end |
#positions ⇒ Object (readonly)
Returns the value of attribute positions.
22 23 24 |
# File 'lib/clef/layout/system_layout.rb', line 22 def positions @positions end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
22 23 24 |
# File 'lib/clef/layout/system_layout.rb', line 22 def score @score end |
#style ⇒ Object (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
#build ⇒ Array<System>
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 |