Class: Dictation::Typewriter
- Inherits:
-
Object
- Object
- Dictation::Typewriter
- Defined in:
- lib/dictation/typewriter.rb
Instance Attribute Summary collapse
-
#words ⇒ Object
Returns the value of attribute words.
Instance Method Summary collapse
- #collect ⇒ Object
-
#initialize ⇒ Typewriter
constructor
A new instance of Typewriter.
Constructor Details
#initialize ⇒ Typewriter
Returns a new instance of Typewriter.
5 6 7 |
# File 'lib/dictation/typewriter.rb', line 5 def initialize @words = [] end |
Instance Attribute Details
#words ⇒ Object
Returns the value of attribute words.
3 4 5 |
# File 'lib/dictation/typewriter.rb', line 3 def words @words end |
Instance Method Details
#collect ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/dictation/typewriter.rb', line 22 def collect paint_puts('Please type word and translation one by one, press Enter key to save. When you finish, press Ctrl+C.', :pink) Signal.trap('SIGINT') do puts '' break end loop do record end paint_puts("=" * 80, :green) paint_puts("Input is done.", :green) @words end |