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, #lightio_initialize, #print, #printf, #puts, #read, #readbyte, #readchar, #readline, #readlines, #readpartial, #wait, #wait_readable, #wait_writable, #write

Instance Method Details

#binmodeObject



238
239
240
241
# File 'lib/lightio/library/io.rb', line 238

def binmode
  @obj.binmode
  self
end

#linenoObject



215
216
217
# File 'lib/lightio/library/io.rb', line 215

def lineno
  @readbuf.lineno
end

#lineno=(no) ⇒ Object



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

def lineno= no
  @readbuf.lineno = no
end

#rewindObject



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

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



232
233
234
235
236
# File 'lib/lightio/library/io.rb', line 232

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

#set_encoding(*args) ⇒ Object



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

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