Class: LightIO::Library::IO

Inherits:
Object
  • Object
show all
Extended by:
Module::IO::ClassMethods
Includes:
Base, IOMethods, Wrap::IOWrapper
Defined in:
lib/lightio/library/io.rb

Direct Known Subclasses

BasicSocket, File

Defined Under Namespace

Modules: IOMethods

Instance Method Summary collapse

Methods included from Module::IO::ClassMethods

copy_stream, open, pipe, select

Methods included from Wrap::IOWrapper

included, #initialize

Methods included from Base

included, #initialize

Methods included from IOMethods

#close, #eof, #flush, #getbyte, #getc, #gets, included, #lightio_initialize, #print, #printf, #puts, #read, #readbyte, #readchar, #readline, #readlines, #readpartial, #wait, #wait_readable, #wait_writable

Instance Method Details

#binmodeObject



225
226
227
228
# File 'lib/lightio/library/io.rb', line 225

def binmode
  @obj.binmode
  self
end

#linenoObject



202
203
204
# File 'lib/lightio/library/io.rb', line 202

def lineno
  @readbuf.lineno
end

#lineno=(no) ⇒ Object



206
207
208
# File 'lib/lightio/library/io.rb', line 206

def lineno= no
  @readbuf.lineno = no
end

#rewindObject



210
211
212
213
214
215
216
217
# File 'lib/lightio/library/io.rb', line 210

def rewind
  # clear buf if seek offset is not zero
  unless @seek.zero?
    @seek = 0
    @readbuf.string.clear
  end
  @readbuf.rewind
end

#seek(*args) ⇒ Object



219
220
221
222
223
# File 'lib/lightio/library/io.rb', line 219

def seek(*args)
  @readbuf.string.clear
  @seek = args[0]
  @obj.seek(*args)
end

#set_encoding(*args) ⇒ Object



197
198
199
200
# File 'lib/lightio/library/io.rb', line 197

def set_encoding(*args)
  @readbuf.set_encoding(*args)
  super(*args)
end

#to_ioObject



11
12
13
# File 'lib/lightio/library/io.rb', line 11

def to_io
  self
end