Class: Matchd::Response::SRV

Inherits:
Matchd::Response show all
Defined in:
lib/matchd/response/srv.rb

Constant Summary

Constants inherited from Matchd::Response

NotImplementedError

Instance Attribute Summary collapse

Attributes inherited from Matchd::Response

#resource_options

Instance Method Summary collapse

Methods inherited from Matchd::Response

#call, #valid?

Constructor Details

#initialize(opts) ⇒ SRV

Returns a new instance of SRV.



2
3
4
5
6
7
8
# File 'lib/matchd/response/srv.rb', line 2

def initialize(opts)
  super
  @target = opts.fetch("target")
  @priority = opts.fetch("priority")
  @weight = opts.fetch("weight")
  @port = opts.fetch("port")
end

Instance Attribute Details

#portObject (readonly)

Returns the value of attribute port.



10
11
12
# File 'lib/matchd/response/srv.rb', line 10

def port
  @port
end

#priorityObject (readonly)

Returns the value of attribute priority.



10
11
12
# File 'lib/matchd/response/srv.rb', line 10

def priority
  @priority
end

#targetObject (readonly)

Returns the value of attribute target.



10
11
12
# File 'lib/matchd/response/srv.rb', line 10

def target
  @target
end

#weightObject (readonly)

Returns the value of attribute weight.



10
11
12
# File 'lib/matchd/response/srv.rb', line 10

def weight
  @weight
end

Instance Method Details

#resourceObject



12
13
14
15
16
17
18
19
# File 'lib/matchd/response/srv.rb', line 12

def resource
  Resolv::DNS::Resource::IN::SRV.new(
    priority,
    weight,
    port,
    target
  )
end