Sha256: a0edb7d566267b6dd7e283f297a3ce773e0ee21caef7a1867d0c35e658a79bcf

Contents?: true

Size: 348 Bytes

Versions: 3

Compression:

Stored size: 348 Bytes

Contents

module NFS
  class Filehandle < ::String
    def initialize
      super("\0".b * NFS::FHSIZE)
    end

    def increment!
      size.times do |i|
        self[i] += 1
        return self if self[i] != 0
      end

      self
    end

    def [](idx)
      getbyte(idx)
    end

    def []=(idx, newval)
      setbyte(idx, newval)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nfs-rb-1.0.2 lib/nfs/filehandle.rb
nfs-rb-1.0.1 lib/nfs/filehandle.rb
nfs-rb-1.0.0 lib/nfs/filehandle.rb