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.



46
47
48
49
50
51
# File 'lib/rio/ios/null.rb', line 46

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

Instance Method Details

#<<(obj) ⇒ Object



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

def <<(obj) self end

#binmodeObject



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

def binmode() self end

#callstr(func, *args) ⇒ Object



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

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

#closeObject



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

def close() @open = false end

#close_readObject



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

def close_read() raise Exception::NotDuplex end

#close_writeObject



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

def close_write()  raise Exception::NotDuplex end

#closed?Boolean

Returns:

  • (Boolean)


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

def closed?() not @open end

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



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

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

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



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

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

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



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

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

#eof?Boolean

Returns:

  • (Boolean)


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

def eof?() true end

#flushObject



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

def flush() nil end

#fsyncObject



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

def fsync() nil end

#getcObject



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

def getc() nil end

#gets(sep_string = $/) ⇒ Object



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

def gets(sep_string=$/) nil end

#isattyObject



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

def isatty() tty? end

#linenoObject



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

def lineno() @lineno end

#lineno=(a) ⇒ Object



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

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

#posObject



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

def pos() 0 end

#pos=(v) ⇒ Object



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

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


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

def print(*objs) nil end

#printf(format, *objs) ⇒ Object



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

def printf(format,*objs) nil end

#putc(obj) ⇒ Object



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

def putc(obj) nil end

#puts(*objs) ⇒ Object



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

def puts(*objs) nil end

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



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

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

#readcharObject

Raises:

  • (EOFError)


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

def readchar() raise EOFError end

#readline(sep_string = $/) ⇒ Object

Raises:

  • (EOFError)


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

def readline(sep_string=$/) raise EOFError end

#readlines(sep_string = $/) ⇒ Object



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

def readlines(sep_string=$/) [] end

#readpartial(maxlen, *args) ⇒ Object

Raises:

  • (EOFError)


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

def readpartial(maxlen,*args)  raise EOFError end

#reopen(*args) ⇒ Object



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

def reopen(*args) self end

#rewindObject



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

def rewind() 0 end

#seek(amount, whence) ⇒ Object



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

def seek(amount,whence) 0 end

#tellObject



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

def tell() pos() end

#tty?Boolean

Returns:

  • (Boolean)


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

def tty?() false end

#write(str) ⇒ Object



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

def write(str) str.length end