Class: Matchd::Response::A

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

Direct Known Subclasses

AAAA

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) ⇒ A

Returns a new instance of A.



2
3
4
5
# File 'lib/matchd/response/a.rb', line 2

def initialize(opts)
  super
  @ip = opts.is_a?(Hash) ? opts.fetch("ip") : opts
end

Instance Attribute Details

#ipObject (readonly)

Returns the value of attribute ip.



7
8
9
# File 'lib/matchd/response/a.rb', line 7

def ip
  @ip
end

Instance Method Details

#resourceObject



9
10
11
# File 'lib/matchd/response/a.rb', line 9

def resource
  Resolv::DNS::Resource::IN::A.new(ip)
end