Class: RIO::IOS::Null

Inherits:
Object show all
Includes:
Fail
Defined in:
lib/rio/ios/null.rb

Overview

:nodoc: all

Instance Method Summary collapse

Methods included from Fail

#fcntl, #fileno, #ioctl, #notsupported, #pid, #stat, #sync, #sync=, #sysread, #sysseek, #syswrite, #to_i, #ungetc

Constructor Details

#initialize(el = nil, m = 'r') ⇒ Null

Returns a new instance of Null.



57
58
59
60
61
62
# File 'lib/rio/ios/null.rb', line 57

def initialize(el=nil,m='r') 
  @lineno = 0
  @open = true
  @mode = Mode.new(m)
  @pos = 0
end

Instance Method Details

#<<(obj) ⇒ Object



66
# File 'lib/rio/ios/null.rb', line 66

def <<(obj) self end

#binmodeObject



67
# File 'lib/rio/ios/null.rb', line 67

def binmode() self end

#callstr(func, *args) ⇒ Object



113
114
115
# File 'lib/rio/ios/null.rb', line 113

def callstr(func,*args)
  self.class.to_s+'['+self.to_s+']'+'.'+func.to_s+'('+args.join(',')+')'
end

#closeObject



68
# File 'lib/rio/ios/null.rb', line 68

def close() @open = false end

#close_readObject



69
# File 'lib/rio/ios/null.rb', line 69

def close_read() raise Exception::NotDuplex end

#close_writeObject



70
# File 'lib/rio/ios/null.rb', line 70

def close_write()  raise Exception::NotDuplex end

#closed?Boolean

Returns:

  • (Boolean)


71
# File 'lib/rio/ios/null.rb', line 71

def closed?() not @open end

#each(sep_string = $/, &block) ⇒ Object



72
# File 'lib/rio/ios/null.rb', line 72

def each(sep_string=$/,&block) self end

#each_byte(sep_string = $/, &block) ⇒ Object



74
# File 'lib/rio/ios/null.rb', line 74

def each_byte(sep_string=$/,&block) self end

#each_line(sep_string = $/, &block) ⇒ Object



73
# File 'lib/rio/ios/null.rb', line 73

def each_line(sep_string=$/,&block) self end

#eof?Boolean

Returns:

  • (Boolean)


75
# File 'lib/rio/ios/null.rb', line 75

def eof?() true end

#flushObject

def fcntl(integer_cmd,arg) notsupported(:fcntl) end def fileno() notsupported(:fileno) end def to_i() notsupported(:to_i) end



79
# File 'lib/rio/ios/null.rb', line 79

def flush() nil end

#fsyncObject



80
# File 'lib/rio/ios/null.rb', line 80

def fsync() nil end

#getcObject



81
# File 'lib/rio/ios/null.rb', line 81

def getc() nil end

#gets(sep_string = $/) ⇒ Object



82
# File 'lib/rio/ios/null.rb', line 82

def gets(sep_string=$/) nil end

#isattyObject



85
# File 'lib/rio/ios/null.rb', line 85

def isatty() tty? end

#linenoObject



86
# File 'lib/rio/ios/null.rb', line 86

def lineno() @lineno end

#lineno=(a) ⇒ Object



87
# File 'lib/rio/ios/null.rb', line 87

def lineno=(a) @lineno = a; lineno() end

#posObject

def pid() notsupported(:pid) end



89
# File 'lib/rio/ios/null.rb', line 89

def pos() 0 end

#pos=(v) ⇒ Object



91
# File 'lib/rio/ios/null.rb', line 91

def pos=(v) @pos = v; pos end


92
# File 'lib/rio/ios/null.rb', line 92

def print(*objs) nil end

#printf(format, *objs) ⇒ Object



93
# File 'lib/rio/ios/null.rb', line 93

def printf(format,*objs) nil end

#putc(obj) ⇒ Object



94
# File 'lib/rio/ios/null.rb', line 94

def putc(obj) nil end

#puts(*objs) ⇒ Object



95
# File 'lib/rio/ios/null.rb', line 95

def puts(*objs) nil end

#read(length = nil, *args) ⇒ Object



96
# File 'lib/rio/ios/null.rb', line 96

def read(length=nil,*args) length.nil? ? "" : nil end

#readcharObject

Raises:

  • (EOFError)


97
# File 'lib/rio/ios/null.rb', line 97

def readchar() raise EOFError end

#readline(sep_string = $/) ⇒ Object

Raises:

  • (EOFError)


98
# File 'lib/rio/ios/null.rb', line 98

def readline(sep_string=$/) raise EOFError end

#readlines(sep_string = $/) ⇒ Object



99
# File 'lib/rio/ios/null.rb', line 99

def readlines(sep_string=$/) [] end

#readpartial(maxlen, *args) ⇒ Object

Raises:

  • (EOFError)


100
# File 'lib/rio/ios/null.rb', line 100

def readpartial(maxlen,*args)  raise EOFError end

#reopen(*args) ⇒ Object



101
# File 'lib/rio/ios/null.rb', line 101

def reopen(*args) self end

#rewindObject



102
# File 'lib/rio/ios/null.rb', line 102

def rewind() 0 end

#seek(amount, whence) ⇒ Object



103
# File 'lib/rio/ios/null.rb', line 103

def seek(amount,whence) 0 end

#tellObject



90
# File 'lib/rio/ios/null.rb', line 90

def tell() pos() end

#tty?Boolean

def ioctl(integer_cmd,arg) notsupported(:ioctl) end

Returns:

  • (Boolean)


84
# File 'lib/rio/ios/null.rb', line 84

def tty?() false end

#write(str) ⇒ Object

def stat() notsupported(:stat) end def sync() notsupported(:sync) end def sync=(v) notsupported(:sync=) end def sysread() notsupported(:sysread) end def sysseek() notsupported(:sysseek) end def syswrite() notsupported(:syswrite) end def ungetc() notsupported(:ungetc) end



111
# File 'lib/rio/ios/null.rb', line 111

def write(str) str.length end