Class: OutroRails::Instruments::Guitar::ChordShapes::Shape
- Inherits:
-
Struct
- Object
- Struct
- OutroRails::Instruments::Guitar::ChordShapes::Shape
- Defined in:
- lib/outro_rails/instruments/guitar/chord_shapes.rb
Overview
One grip in the library. See the module comment for what each field means; instances are frozen by .shape below.
Instance Attribute Summary collapse
-
#frets ⇒ Object
Returns the value of attribute frets.
-
#movable_omit ⇒ Object
Returns the value of attribute movable_omit.
-
#name ⇒ Object
Returns the value of attribute name.
-
#root_string ⇒ Object
Returns the value of attribute root_string.
Instance Method Summary collapse
-
#caged_letter ⇒ Object
The CAGED family this shape descends from: :am7 => "A", :d_sus2 => "D".
-
#movable_frets ⇒ Object
The grip as barred up the neck, without the omitted strings.
-
#root_fret ⇒ Object
Fret played on the root string in open position.
Instance Attribute Details
#frets ⇒ Object
Returns the value of attribute frets
35 36 37 |
# File 'lib/outro_rails/instruments/guitar/chord_shapes.rb', line 35 def frets @frets end |
#movable_omit ⇒ Object
Returns the value of attribute movable_omit
35 36 37 |
# File 'lib/outro_rails/instruments/guitar/chord_shapes.rb', line 35 def movable_omit @movable_omit end |
#name ⇒ Object
Returns the value of attribute name
35 36 37 |
# File 'lib/outro_rails/instruments/guitar/chord_shapes.rb', line 35 def name @name end |
#root_string ⇒ Object
Returns the value of attribute root_string
35 36 37 |
# File 'lib/outro_rails/instruments/guitar/chord_shapes.rb', line 35 def root_string @root_string end |
Instance Method Details
#caged_letter ⇒ Object
The CAGED family this shape descends from: :am7 => "A", :d_sus2 => "D". Shape names are spelled from their namesake chord, so the first character is always the family letter.
53 54 55 |
# File 'lib/outro_rails/instruments/guitar/chord_shapes.rb', line 53 def caged_letter name.to_s[0].upcase end |
#movable_frets ⇒ Object
The grip as barred up the neck, without the omitted strings
46 47 48 |
# File 'lib/outro_rails/instruments/guitar/chord_shapes.rb', line 46 def movable_frets frets.reject { |string, _| movable_omit.include?(string) } end |
#root_fret ⇒ Object
Fret played on the root string in open position
41 42 43 |
# File 'lib/outro_rails/instruments/guitar/chord_shapes.rb', line 41 def root_fret frets.fetch(root_string) end |