class Pathname
ByteSize
adds two new methods to the Pathname class:
-
#bytesize
-
#bytesize?
Plus the equivalent methods for IECByteSize:
-
#iecbytesize
-
#iecbytesize?
Public Instance Methods
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
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
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
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