Class: Clef::Core::Clef
- Inherits:
-
Object
- Object
- Clef::Core::Clef
- Defined in:
- lib/clef/core/clef.rb
Constant Summary collapse
- TYPES =
%i[treble bass alto tenor soprano mezzo_soprano baritone percussion tab].freeze
- REFERENCE =
{ treble: [[:b, 4], 2], bass: [[:d, 3], 2], alto: [[:c, 4], 2], tenor: [[:a, 3], 2], soprano: [[:g, 4], 2], mezzo_soprano: [[:e, 4], 2], baritone: [[:f, 3], 2], percussion: [[:b, 4], 2], tab: [[:b, 4], 2] }.freeze
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type) ⇒ Clef
constructor
A new instance of Clef.
- #reference_line ⇒ Integer
- #reference_pitch ⇒ Pitch
Constructor Details
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
19 20 21 |
# File 'lib/clef/core/clef.rb', line 19 def type @type end |
Instance Method Details
#reference_line ⇒ Integer
35 36 37 |
# File 'lib/clef/core/clef.rb', line 35 def reference_line REFERENCE.fetch(type).last end |