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