Class: Bychar::Wrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/bychar.rb

Overview

The basic wrapper that you get from wrap()

Instance Method Summary collapse

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_charObject



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_charObject



18
19
20
# File 'lib/bychar.rb', line 18

def read_one_char
  @io.read_one_char
end