Class: IceStorm::LinkInfo

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Ice::Inspect_mixin

#inspect

Constructor Details

#initialize(theTopic = nil, name = '', cost = 0) ⇒ LinkInfo

Returns a new instance of LinkInfo.



32
33
34
35
36
# File 'lib/IceStorm/IceStorm.rb', line 32

def initialize(theTopic=nil, name='', cost=0)
    @theTopic = theTopic
    @name = name
    @cost = cost
end

Instance Attribute Details

#costObject

Returns the value of attribute cost.



58
59
60
# File 'lib/IceStorm/IceStorm.rb', line 58

def cost
  @cost
end

#nameObject

Returns the value of attribute name.



58
59
60
# File 'lib/IceStorm/IceStorm.rb', line 58

def name
  @name
end

#theTopicObject

Returns the value of attribute theTopic.



58
59
60
# File 'lib/IceStorm/IceStorm.rb', line 58

def theTopic
  @theTopic
end

Instance Method Details

#==(other) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/IceStorm/IceStorm.rb', line 46

def ==(other)
    return false if !other.is_a? ::IceStorm::LinkInfo or
        @theTopic != other.theTopic or
        @name != other.name or
        @cost != other.cost
    true
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/IceStorm/IceStorm.rb', line 54

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

#hashObject



38
39
40
41
42
43
44
# File 'lib/IceStorm/IceStorm.rb', line 38

def hash
    _h = 0
    _h = 5 * _h + @theTopic.hash
    _h = 5 * _h + @name.hash
    _h = 5 * _h + @cost.hash
    _h % 0x7fffffff
end