Class: Scriptroute::Tulip::TraceHop

Inherits:
Object
  • Object
show all
Defined in:
lib/scriptroute/tulip/helper.rb

Overview

a traceroute hop ##################

Constant Summary collapse

@@aliasTesting =
false

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hop, ip, dst, name = ip) ⇒ TraceHop

Returns a new instance of TraceHop.



593
594
595
596
597
598
# File 'lib/scriptroute/tulip/helper.rb', line 593

def initialize (hop, ip, dst, name=ip) 
  @hop = hop;
  @ip = ip;
  @dst = dst;
  @name = name;
end

Instance Attribute Details

#dstObject (readonly)

Returns the value of attribute dst.



592
593
594
# File 'lib/scriptroute/tulip/helper.rb', line 592

def dst
  @dst
end

#hopObject (readonly)

Returns the value of attribute hop.



592
593
594
# File 'lib/scriptroute/tulip/helper.rb', line 592

def hop
  @hop
end

#ipObject (readonly)

Returns the value of attribute ip.



592
593
594
# File 'lib/scriptroute/tulip/helper.rb', line 592

def ip
  @ip
end

#nameObject (readonly)

Returns the value of attribute name.



592
593
594
# File 'lib/scriptroute/tulip/helper.rb', line 592

def name
  @name
end

Instance Method Details

#==(another) ⇒ Object

todo: set this right



601
602
603
604
605
# File 'lib/scriptroute/tulip/helper.rb', line 601

def == (another)
  return true if (@ip == another.ip);
  return AliasResolution.aliases(self, another) if (@@aliasTesting);
  return false;
end

#to_sObject



607
608
609
# File 'lib/scriptroute/tulip/helper.rb', line 607

def to_s 
  return "#{@hop.to_s} #{@name.to_s} (#{@ip.to_s})";
end