Class: IcePatch2::FileInfo
- Inherits:
-
Object
- Object
- IcePatch2::FileInfo
- Defined in:
- lib/IcePatch2/FileInfo.rb
Instance Attribute Summary collapse
-
#checksum ⇒ Object
Returns the value of attribute checksum.
-
#executable ⇒ Object
Returns the value of attribute executable.
-
#path ⇒ Object
Returns the value of attribute path.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(path = '', checksum = nil, size = 0, executable = false) ⇒ FileInfo
constructor
A new instance of FileInfo.
- #inspect ⇒ Object
Constructor Details
#initialize(path = '', checksum = nil, size = 0, executable = false) ⇒ FileInfo
Returns a new instance of FileInfo.
29 30 31 32 33 34 |
# File 'lib/IcePatch2/FileInfo.rb', line 29 def initialize(path='', checksum=nil, size=0, executable=false) @path = path @checksum = checksum @size = size @executable = executable end |
Instance Attribute Details
#checksum ⇒ Object
Returns the value of attribute checksum.
62 63 64 |
# File 'lib/IcePatch2/FileInfo.rb', line 62 def checksum @checksum end |
#executable ⇒ Object
Returns the value of attribute executable.
62 63 64 |
# File 'lib/IcePatch2/FileInfo.rb', line 62 def executable @executable end |
#path ⇒ Object
Returns the value of attribute path.
62 63 64 |
# File 'lib/IcePatch2/FileInfo.rb', line 62 def path @path end |
#size ⇒ Object
Returns the value of attribute size.
62 63 64 |
# File 'lib/IcePatch2/FileInfo.rb', line 62 def size @size end |
Instance Method Details
#==(other) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/IcePatch2/FileInfo.rb', line 45 def ==(other) return false if !other.is_a? ::IcePatch2::FileInfo or @path != other.path or @checksum != other.checksum or @size != other.size or @executable != other.executable true end |
#eql?(other) ⇒ Boolean
54 55 56 |
# File 'lib/IcePatch2/FileInfo.rb', line 54 def eql?(other) return other.class == self.class && other == self end |
#hash ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/IcePatch2/FileInfo.rb', line 36 def hash _h = 0 _h = 5 * _h + @path.hash _h = 5 * _h + @checksum.hash _h = 5 * _h + @size.hash _h = 5 * _h + @executable.hash _h % 0x7fffffff end |
#inspect ⇒ Object
58 59 60 |
# File 'lib/IcePatch2/FileInfo.rb', line 58 def inspect ::Ice::__stringify(self, T_FileInfo) end |