Class: Clef::Notation::Barline
- Inherits:
-
Object
- Object
- Clef::Notation::Barline
- Defined in:
- lib/clef/notation/barline.rb
Constant Summary collapse
- TYPES =
%i[single double final repeat_start repeat_end repeat_both].freeze
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type = :single) ⇒ Barline
constructor
A new instance of Barline.
- #to_symbol ⇒ String
Constructor Details
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/clef/notation/barline.rb', line 8 def type @type end |
Instance Method Details
#to_symbol ⇒ String
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/clef/notation/barline.rb', line 18 def to_symbol { single: "|", double: "||", final: "|.", repeat_start: ".|:", repeat_end: ":|.", repeat_both: ":|.|:" }.fetch(type) end |