Class: RIO::Mode::Base
Direct Known Subclasses
Int, Str
Instance Method Summary
collapse
Methods included from Fwd
fwd, fwd_reader, fwd_readers, fwd_writer, fwd_writers
Constructor Details
#initialize(arg) ⇒ Base
Returns a new instance of Base.
35
36
37
38
39
40
41
|
# File 'lib/rio/iomode.rb', line 35
def initialize(arg)
if arg.kind_of? self.class
copy(arg)
else
@mode = arg
end
end
|
Instance Method Details
#allows_read? ⇒ Boolean
57
58
59
|
# File 'lib/rio/iomode.rb', line 57
def allows_read?()
primarily_read? or allows_both?
end
|
#allows_write? ⇒ Boolean
60
61
62
|
# File 'lib/rio/iomode.rb', line 60
def allows_write?()
primarily_write? or allows_both?
end
|
#copy(other) ⇒ Object
43
44
45
|
# File 'lib/rio/iomode.rb', line 43
def copy(other)
@mode = other.mode
end
|
#read_only? ⇒ Boolean
51
52
53
|
# File 'lib/rio/iomode.rb', line 51
def read_only?()
allows_read? and !allows_write?
end
|
47
|
# File 'lib/rio/iomode.rb', line 47
def to_s() @mode.to_s end
|
#write_only? ⇒ Boolean
54
55
56
|
# File 'lib/rio/iomode.rb', line 54
def write_only?()
!allows_read? and allows_read?
end
|