Class: Junoser::Input
- Inherits:
-
Object
- Object
- Junoser::Input
- Defined in:
- lib/junoser/input.rb
Instance Method Summary collapse
-
#initialize(io_or_string) ⇒ Input
constructor
A new instance of Input.
- #read ⇒ Object
Constructor Details
#initialize(io_or_string) ⇒ Input
Returns a new instance of Input.
3 4 5 |
# File 'lib/junoser/input.rb', line 3 def initialize(io_or_string) @io_or_string = io_or_string end |
Instance Method Details
#read ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/junoser/input.rb', line 7 def read content = if @io_or_string.respond_to?(:read) @io_or_string.read else @io_or_string.to_s end content = remove_blank_and_comment_line(content) content = unify_carriage_return(content) end |