Class: Vedeu::Input::Key Private
- Inherits:
-
Object
- Object
- Vedeu::Input::Key
- Defined in:
- lib/vedeu/input/key.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A single keypress or combination of keypresses bound to a specific action.
Instance Attribute Summary collapse
-
#input ⇒ String|Symbol
(also: #key)
readonly
private
Returns the key defined.
Instance Method Summary collapse
-
#initialize(input = nil, &block) ⇒ Vedeu::Input::Key
constructor
private
Returns a new instance of Vedeu::Input::Key.
-
#output ⇒ |Symbol
(also: #action, #press)
private
Pressing the key will call the procedure.
Constructor Details
#initialize(input = nil, &block) ⇒ Vedeu::Input::Key
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Vedeu::Input::Key.
25 26 27 28 29 30 |
# File 'lib/vedeu/input/key.rb', line 25 def initialize(input = nil, &block) raise Vedeu::Error::RequiresBlock unless block_given? @input = input @output = block end |
Instance Attribute Details
#input ⇒ String|Symbol (readonly) Also known as: key
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the key defined.
16 17 18 |
# File 'lib/vedeu/input/key.rb', line 16 def input @input end |
Instance Method Details
#output ⇒ |Symbol Also known as: action, press
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Pressing the key will call the procedure.
35 36 37 |
# File 'lib/vedeu/input/key.rb', line 35 def output @output.call end |