Class: DNSSD::Reply::Register

Inherits:
DNSSD::Reply show all
Defined in:
lib/dnssd/reply/register.rb

Overview

Returned by DNSSD::Service#register

Instance Attribute Summary collapse

Attributes inherited from DNSSD::Reply

#flags, #interface, #service

Instance Method Summary collapse

Methods inherited from DNSSD::Reply

#fullname, #interface_name, #protocol, #service_name, #set_fullname, #set_names

Constructor Details

#initialize(service, flags, name, type, domain) ⇒ Register

Creates a Register, called internally by DNSSD::Service#register



24
25
26
27
28
# File 'lib/dnssd/reply/register.rb', line 24

def initialize(service, flags, name, type, domain)
  super service, flags, nil

  set_names name, type, domain
end

Instance Attribute Details

#domainObject (readonly)

A domain for registration or browsing



9
10
11
# File 'lib/dnssd/reply/register.rb', line 9

def domain
  @domain
end

#nameObject (readonly)

The service name



14
15
16
# File 'lib/dnssd/reply/register.rb', line 14

def name
  @name
end

#typeObject (readonly)

The service type



19
20
21
# File 'lib/dnssd/reply/register.rb', line 19

def type
  @type
end

Instance Method Details

#inspectObject

:nodoc:



35
36
37
38
39
# File 'lib/dnssd/reply/register.rb', line 35

def inspect # :nodoc:
  "#<%s:0x%x %p flags: %p>" % [
    self.class, object_id, fullname, @flags
  ]
end

#resolveObject



30
31
32
33
# File 'lib/dnssd/reply/register.rb', line 30

def resolve
  service = DNSSD::Service.resolve name, type, domain
  service.first
end