Class: Testjour::Bonjour::Server

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, host, port) ⇒ Server

Returns a new instance of Server.



14
15
16
17
18
# File 'lib/testjour/bonjour.rb', line 14

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

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



12
13
14
# File 'lib/testjour/bonjour.rb', line 12

def host
  @host
end

#nameObject (readonly)

Returns the value of attribute name.



12
13
14
# File 'lib/testjour/bonjour.rb', line 12

def name
  @name
end

#portObject (readonly)

Returns the value of attribute port.



12
13
14
# File 'lib/testjour/bonjour.rb', line 12

def port
  @port
end

Instance Method Details

#==(other) ⇒ Object



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

def ==(other)
  other.class == self.class && other.uri == self.uri
end

#uriObject



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

def uri
  "druby://" + @host.gsub(/\.$/, "") + ":" + @port.to_s
end