Class: LogSimulator::Target

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, target_name, port) ⇒ Target

Returns a new instance of Target.



10
11
12
13
14
# File 'lib/resolve.rb', line 10

def initialize(name,target_name,port)
  @name = name
  @target_name = target_name
  @port = port
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/resolve.rb', line 8

def name
  @name
end

#portObject

Returns the value of attribute port.



8
9
10
# File 'lib/resolve.rb', line 8

def port
  @port
end

#target_nameObject

Returns the value of attribute target_name.



8
9
10
# File 'lib/resolve.rb', line 8

def target_name
  @target_name
end

Instance Method Details

#==(o) ⇒ Object



20
21
22
# File 'lib/resolve.rb', line 20

def ==(o)
  o.class == self.class && o.target_name == @target_name && o.port == @port
end

#eql?(o) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/resolve.rb', line 16

def eql?(o)
  self == o
end

#hashObject



24
25
26
# File 'lib/resolve.rb', line 24

def hash
  @target_name.hash
end