Class: Bychar::Wrapper
- Inherits:
-
Object
- Object
- Bychar::Wrapper
- Defined in:
- lib/bychar.rb
Overview
The basic wrapper that you get from wrap()
Instance Method Summary collapse
- #each_char ⇒ Object
-
#initialize(io_to_wrap) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #read_one_char ⇒ Object
Constructor Details
#initialize(io_to_wrap) ⇒ Wrapper
Returns a new instance of Wrapper.
14 15 16 |
# File 'lib/bychar.rb', line 14 def initialize(io_to_wrap) @io = io_to_wrap end |
Instance Method Details
#each_char ⇒ Object
22 23 24 25 26 |
# File 'lib/bychar.rb', line 22 def each_char while char = read_one_char do yield char end end |
#read_one_char ⇒ Object
18 19 20 |
# File 'lib/bychar.rb', line 18 def read_one_char @io.read_one_char end |