Class: RIO::Mode::Int

Inherits:
Base show all
Defined in:
lib/rio/iomode.rb

Instance Method Summary collapse

Methods inherited from Base

#allows_read?, #allows_write?, #copy, #initialize, #read_only?, #to_s, #write_only?

Methods included from Fwd

#fwd, #fwd_reader, #fwd_readers, #fwd_writer, #fwd_writers

Constructor Details

This class inherits a constructor from RIO::Mode::Base

Instance Method Details

#allows_both?Boolean

@mode&File::APPEND

Returns:

  • (Boolean)


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

def allows_both?()
#        @mode[1,-1] == '+'
end

#creates?Boolean

@mode == ‘+’

Returns:

  • (Boolean)


93
94
95
# File 'lib/rio/iomode.rb', line 93

def creates?() 
  # primarily_append? || primarily_write? 
end

#primarily_append?Boolean

@mode&File::WRONLY || (@mode&File::RDWR && @mode&File::TRUNC) || primarily_append?

Returns:

  • (Boolean)


87
88
89
# File 'lib/rio/iomode.rb', line 87

def primarily_append?() 
#        @mode&File::APPEND
end

#primarily_read?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/rio/iomode.rb', line 81

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)))

Returns:

  • (Boolean)


84
85
86
# File 'lib/rio/iomode.rb', line 84

def primarily_write?() 
#        @mode&File::WRONLY || (@mode&File::RDWR && @mode&File::TRUNC) || primarily_append? 
end