class Pathname

ByteSize adds two new methods to the Pathname class:

Plus the equivalent methods for IECByteSize:

Public Instance Methods

bytesize → bytesize click to toggle source

Identical to {Pathname#size}[https://ruby-doc.org/stdlib/libdoc/pathname/rdoc/Pathname.html#method-i-size] except that the value is returned as an instance of ByteSize.

# File lib/bytesize.rb, line 1238
def bytesize
        ByteSize.new(size)
end
bytesize? → bytesize or nil click to toggle source

Identical to {Pathname#size?}[https://ruby-doc.org/stdlib/libdoc/pathname/rdoc/Pathname.html#method-i-size-3F] except that the value is returned as an instance of ByteSize.

# File lib/bytesize.rb, line 1251
def bytesize?
        sz = size?
        sz.nil? ? nil : ByteSize.new(sz)
end
iecbytesize → bytesize click to toggle source

Identical to {Pathname#size}[https://ruby-doc.org/stdlib/libdoc/pathname/rdoc/Pathname.html#method-i-size] except that the value is returned as an instance of IECByteSize.

# File lib/bytesize.rb, line 1265
def iecbytesize
        IECByteSize.new(size)
end
iecbytesize? → bytesize or nil click to toggle source

Identical to {Pathname#size?}[https://ruby-doc.org/stdlib/libdoc/pathname/rdoc/Pathname.html#method-i-size-3F] except that the value is returned as an instance of IECByteSize.

# File lib/bytesize.rb, line 1278
def iecbytesize?
        sz = size?
        sz.nil? ? nil : IECByteSize.new(sz)
end