Class: OutroRails::Instruments::Guitar::Tunings::Tuning
- Inherits:
-
Struct
- Object
- Struct
- OutroRails::Instruments::Guitar::Tunings::Tuning
- Defined in:
- lib/outro_rails/instruments/guitar/tunings.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#prefer ⇒ Object
Returns the value of attribute prefer.
-
#slug ⇒ Object
Returns the value of attribute slug.
Instance Method Summary collapse
-
#label ⇒ Object
"Drop D - D A D G B E".
-
#letters ⇒ Object
Open-string letters without octaves, low to high: %w[D A D G B E].
-
#standard? ⇒ Boolean
True only for the tuning we fall back to when none is given.
-
#to_s ⇒ Object
Interpolates as the display name: "#tuning" => "Drop D".
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
10 11 12 |
# File 'lib/outro_rails/instruments/guitar/tunings.rb', line 10 def name @name end |
#notes ⇒ Object
Returns the value of attribute notes
10 11 12 |
# File 'lib/outro_rails/instruments/guitar/tunings.rb', line 10 def notes @notes end |
#prefer ⇒ Object
Returns the value of attribute prefer
10 11 12 |
# File 'lib/outro_rails/instruments/guitar/tunings.rb', line 10 def prefer @prefer end |
#slug ⇒ Object
Returns the value of attribute slug
10 11 12 |
# File 'lib/outro_rails/instruments/guitar/tunings.rb', line 10 def slug @slug end |
Instance Method Details
#label ⇒ Object
"Drop D - D A D G B E"
26 27 28 |
# File 'lib/outro_rails/instruments/guitar/tunings.rb', line 26 def label "#{name} - #{letters.join(' ')}" end |
#letters ⇒ Object
Open-string letters without octaves, low to high: %w[D A D G B E]
21 22 23 |
# File 'lib/outro_rails/instruments/guitar/tunings.rb', line 21 def letters notes.map { |note| note.sub(/-?\d+\z/, "") } end |
#standard? ⇒ Boolean
True only for the tuning we fall back to when none is given.
16 17 18 |
# File 'lib/outro_rails/instruments/guitar/tunings.rb', line 16 def standard? slug == "standard" end |
#to_s ⇒ Object
Interpolates as the display name: "#tuning" => "Drop D"
31 32 33 |
# File 'lib/outro_rails/instruments/guitar/tunings.rb', line 31 def to_s name end |