Class: HeadMusic::Instrument::StaffScheme
- Inherits:
-
Object
- Object
- HeadMusic::Instrument::StaffScheme
- Defined in:
- lib/head_music/instrument/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.
4 5 6 7 8 |
# File 'lib/head_music/instrument/staff_scheme.rb', line 4 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.
2 3 4 |
# File 'lib/head_music/instrument/staff_scheme.rb', line 2 def key @key end |
#list ⇒ Object (readonly)
Returns the value of attribute list.
2 3 4 |
# File 'lib/head_music/instrument/staff_scheme.rb', line 2 def list @list end |
#variant ⇒ Object (readonly)
Returns the value of attribute variant.
2 3 4 |
# File 'lib/head_music/instrument/staff_scheme.rb', line 2 def variant @variant end |
Instance Method Details
#default? ⇒ Boolean
10 11 12 |
# File 'lib/head_music/instrument/staff_scheme.rb', line 10 def default? key.to_s == "default" end |
#staves ⇒ Object
14 15 16 17 18 |
# File 'lib/head_music/instrument/staff_scheme.rb', line 14 def staves @staves ||= list.map do |attributes| HeadMusic::Instrument::Staff.new(self, attributes) end end |