Class: Morseficator::Input::File
- Inherits:
-
Object
- Object
- Morseficator::Input::File
- Defined in:
- lib/morseficator/input/file.rb
Overview
Represents a file input
Instance Method Summary collapse
-
#initialize(file) ⇒ File
constructor
A new instance of File.
- #map_lines(&block) ⇒ Object
Constructor Details
#initialize(file) ⇒ File
Returns a new instance of File.
7 8 9 |
# File 'lib/morseficator/input/file.rb', line 7 def initialize(file) @file = file end |
Instance Method Details
#map_lines(&block) ⇒ Object
11 12 13 |
# File 'lib/morseficator/input/file.rb', line 11 def map_lines(&block) file.each_line.map { block.call(_1.chomp) } end |