Class: RIO::Mode::Int
Instance Method Summary collapse
-
#allows_both? ⇒ Boolean
@mode&File::APPEND.
-
#creates? ⇒ Boolean
@mode == ‘+’.
-
#primarily_append? ⇒ Boolean
@mode&File::WRONLY || (@mode&File::RDWR && @mode&File::TRUNC) || primarily_append?.
- #primarily_read? ⇒ Boolean
-
#primarily_write? ⇒ Boolean
(@mode&File::RDONLY || (@mode&File::RDWR && ~(@mode&File::TRUNC))).
Methods inherited from Base
#allows_read?, #allows_write?, #copy, #initialize, #read_only?, #to_s, #write_only?
Constructor Details
This class inherits a constructor from RIO::Mode::Base
Instance Method Details
#allows_both? ⇒ Boolean
@mode&File::APPEND
101 102 103 |
# File 'lib/rio/iomode.rb', line 101 def allows_both?() # @mode[1,-1] == '+' end |
#creates? ⇒ Boolean
@mode == ‘+’
104 105 106 |
# File 'lib/rio/iomode.rb', line 104 def creates?() # primarily_append? || primarily_write? end |
#primarily_append? ⇒ Boolean
@mode&File::WRONLY || (@mode&File::RDWR && @mode&File::TRUNC) || primarily_append?
98 99 100 |
# File 'lib/rio/iomode.rb', line 98 def primarily_append?() # @mode&File::APPEND end |
#primarily_read? ⇒ Boolean
92 93 94 |
# File 'lib/rio/iomode.rb', line 92 def primarily_read?() # (@mode&File::RDONLY || (@mode&File::RDWR && ~(@mode&File::TRUNC))) end |
#primarily_write? ⇒ Boolean
(@mode&File::RDONLY || (@mode&File::RDWR && ~(@mode&File::TRUNC)))
95 96 97 |
# File 'lib/rio/iomode.rb', line 95 def primarily_write?() # @mode&File::WRONLY || (@mode&File::RDWR && @mode&File::TRUNC) || primarily_append? end |