Class: RIO::StdIO::RL
- Defined in:
- lib/rio/scheme/stdio.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(sch = RIOSCHEME) ⇒ RL
constructor
A new instance of RL.
-
#opaque ⇒ Object
super.
- #open(m) ⇒ Object
Constructor Details
#initialize(sch = RIOSCHEME) ⇒ RL
Returns a new instance of RL.
46 47 48 49 |
# File 'lib/rio/scheme/stdio.rb', line 46 def initialize(sch=RIOSCHEME) @scheme = sch #super end |
Instance Attribute Details
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
45 46 47 |
# File 'lib/rio/scheme/stdio.rb', line 45 def scheme @scheme end |
Instance Method Details
#close ⇒ Object
65 66 67 68 |
# File 'lib/rio/scheme/stdio.rb', line 65 def close() @scheme = RIOSCHEME self.ios = nil end |
#open(m) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/rio/scheme/stdio.rb', line 52 def open(m) case when m.primarily_read? @scheme = 'stdin' return super($stdin.clone) when m.primarily_write? @scheme = 'stdout' return super($stdout.clone) else raise ArgumentError,sprintf("Can not %s a %s with mode '%s'",'open',self.class,m) end nil end |