Class: IceStorm::LinkInfo

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of LinkInfo.



36
37
38
39
40
# File 'lib/IceStorm/IceStorm.rb', line 36

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

Instance Attribute Details

#costObject

Returns the value of attribute cost.



66
67
68
# File 'lib/IceStorm/IceStorm.rb', line 66

def cost
  @cost
end

#nameObject

Returns the value of attribute name.



66
67
68
# File 'lib/IceStorm/IceStorm.rb', line 66

def name
  @name
end

#theTopicObject

Returns the value of attribute theTopic.



66
67
68
# File 'lib/IceStorm/IceStorm.rb', line 66

def theTopic
  @theTopic
end

Instance Method Details

#==(other) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/IceStorm/IceStorm.rb', line 50

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)


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

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

#hashObject



42
43
44
45
46
47
48
# File 'lib/IceStorm/IceStorm.rb', line 42

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

#inspectObject



62
63
64
# File 'lib/IceStorm/IceStorm.rb', line 62

def inspect
    ::Ice::__stringify(self, T_LinkInfo)
end