Class: Vedeu::Input::Translator
- Inherits:
-
Object
- Object
- Vedeu::Input::Translator
- Defined in:
- lib/vedeu/input/translator.rb
Overview
Translates escape sequences provided by the terminal into symbols which Vedeu can use for various behaviours.
Instance Attribute Summary collapse
- #code ⇒ String readonly protected
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(code) ⇒ Vedeu::Input::Translator
constructor
Returns a new instance of Vedeu::Input::Translator.
- #translate ⇒ Symbol
Constructor Details
#initialize(code) ⇒ Vedeu::Input::Translator
Returns a new instance of Vedeu::Input::Translator.
22 23 24 |
# File 'lib/vedeu/input/translator.rb', line 22 def initialize(code) @code = code end |
Instance Attribute Details
#code ⇒ String (readonly, protected)
35 36 37 |
# File 'lib/vedeu/input/translator.rb', line 35 def code @code end |
Class Method Details
.translate(code) ⇒ Symbol
14 15 16 |
# File 'lib/vedeu/input/translator.rb', line 14 def self.translate(code) new(code).translate end |