Class: WTFChord::Keyboard
- Inherits:
-
Object
- Object
- WTFChord::Keyboard
- Defined in:
- lib/wtf_chord/keyboard.rb
Constant Summary collapse
- KEYS =
%w(C C# D D# E F F# G G# A Bb B)
Instance Attribute Summary collapse
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
Instance Method Summary collapse
- #[](idx) ⇒ Object
-
#initialize(octaves = 1..5) ⇒ Keyboard
constructor
A new instance of Keyboard.
Constructor Details
Instance Attribute Details
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
7 8 9 |
# File 'lib/wtf_chord/keyboard.rb', line 7 def keys @keys end |
Instance Method Details
#[](idx) ⇒ Object
15 16 17 18 19 |
# File 'lib/wtf_chord/keyboard.rb', line 15 def [] idx case idx when 1..@keys.size then @keys[~-idx] end end |