Class: Glare::Domain
- Inherits:
-
Object
- Object
- Glare::Domain
- Defined in:
- lib/glare/domain.rb
Defined Under Namespace
Instance Method Summary collapse
- #deregister(fqdn, type) ⇒ Object
-
#initialize(client) ⇒ Domain
constructor
A new instance of Domain.
- #register(fqdn, destinations, type) ⇒ Object
- #resolve(fqdn, type) ⇒ Object
Constructor Details
#initialize(client) ⇒ Domain
Returns a new instance of Domain.
90 91 92 |
# File 'lib/glare/domain.rb', line 90 def initialize(client) @client = client end |
Instance Method Details
#deregister(fqdn, type) ⇒ Object
109 110 111 112 113 |
# File 'lib/glare/domain.rb', line 109 def deregister(fqdn, type) zone = Zone.new(@client, fqdn) dns_records = zone.records(type) Record.deregister(@client, zone, dns_records) end |
#register(fqdn, destinations, type) ⇒ Object
94 95 96 97 98 99 100 101 |
# File 'lib/glare/domain.rb', line 94 def register(fqdn, destinations, type) dns_records = Array(destinations).map do |destination| DnsRecord.new(type: type, name: fqdn, content: destination) end zone = Zone.new(@client, fqdn) Record.register(@client, zone, dns_records) end |