Class: HeadMusic::Instruments::StaffScheme
- Inherits:
-
Object
- Object
- HeadMusic::Instruments::StaffScheme
- Defined in:
- lib/head_music/instruments/staff_scheme.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#variant ⇒ Object
readonly
Returns the value of attribute variant.
Instance Method Summary collapse
- #default? ⇒ Boolean
-
#initialize(variant:, key:, list:) ⇒ StaffScheme
constructor
A new instance of StaffScheme.
- #staves ⇒ Object
Constructor Details
#initialize(variant:, key:, list:) ⇒ StaffScheme
Returns a new instance of StaffScheme.
9 10 11 12 13 |
# File 'lib/head_music/instruments/staff_scheme.rb', line 9 def initialize(variant:, key:, list:) @variant = variant @key = key || "default" @list = list end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/head_music/instruments/staff_scheme.rb', line 7 def key @key end |
#list ⇒ Object (readonly)
Returns the value of attribute list.
7 8 9 |
# File 'lib/head_music/instruments/staff_scheme.rb', line 7 def list @list end |
#variant ⇒ Object (readonly)
Returns the value of attribute variant.
7 8 9 |
# File 'lib/head_music/instruments/staff_scheme.rb', line 7 def variant @variant end |
Instance Method Details
#default? ⇒ Boolean
15 16 17 |
# File 'lib/head_music/instruments/staff_scheme.rb', line 15 def default? key.to_s == "default" end |
#staves ⇒ Object
19 20 21 22 23 |
# File 'lib/head_music/instruments/staff_scheme.rb', line 19 def staves @staves ||= list.map do |attributes| HeadMusic::Instruments::Staff.new(self, attributes) end end |