Class: Key
- Inherits:
-
Object
- Object
- Key
- Defined in:
- app/key.rb
Instance Method Summary collapse
- #button ⇒ Object
-
#initialize(ch) ⇒ Key
constructor
A new instance of Key.
Constructor Details
#initialize(ch) ⇒ Key
Returns a new instance of Key.
2 3 4 |
# File 'app/key.rb', line 2 def initialize(ch) @ch = ch end |
Instance Method Details
#button ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/key.rb', line 6 def case @ch when 'k' :up when 'j' :down when 'o', 10 :enter when 'q' :quit else logger.info("Pressed key is #{@ch}") end end |