Class: IcePatch2::LargeFileInfo

Inherits:
Object
  • Object
show all
Includes:
Ice::Inspect_mixin
Defined in:
lib/IcePatch2/FileInfo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Ice::Inspect_mixin

#inspect

Constructor Details

#initialize(path = '', checksum = nil, size = 0, executable = false) ⇒ LargeFileInfo

Returns a new instance of LargeFileInfo.



72
73
74
75
76
77
# File 'lib/IcePatch2/FileInfo.rb', line 72

def initialize(path='', checksum=nil, size=0, executable=false)
    @path = path
    @checksum = checksum
    @size = size
    @executable = executable
end

Instance Attribute Details

#checksumObject

Returns the value of attribute checksum.



101
102
103
# File 'lib/IcePatch2/FileInfo.rb', line 101

def checksum
  @checksum
end

#executableObject

Returns the value of attribute executable.



101
102
103
# File 'lib/IcePatch2/FileInfo.rb', line 101

def executable
  @executable
end

#pathObject

Returns the value of attribute path.



101
102
103
# File 'lib/IcePatch2/FileInfo.rb', line 101

def path
  @path
end

#sizeObject

Returns the value of attribute size.



101
102
103
# File 'lib/IcePatch2/FileInfo.rb', line 101

def size
  @size
end

Instance Method Details

#==(other) ⇒ Object



88
89
90
91
92
93
94
95
# File 'lib/IcePatch2/FileInfo.rb', line 88

def ==(other)
    return false if !other.is_a? ::IcePatch2::LargeFileInfo or
        @path != other.path or
        @checksum != other.checksum or
        @size != other.size or
        @executable != other.executable
    true
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


97
98
99
# File 'lib/IcePatch2/FileInfo.rb', line 97

def eql?(other)
    return other.class == self.class && other == self
end

#hashObject



79
80
81
82
83
84
85
86
# File 'lib/IcePatch2/FileInfo.rb', line 79

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