Class: HetznerDNS::Zone

Inherits:
Object
  • Object
show all
Defined in:
lib/hetzner_dns/models/zone.rb

Class Method Summary collapse

Methods inherited from Object

#initialize, #to_ostruct

Constructor Details

This class inherits a constructor from HetznerDNS::Object

Class Method Details

.create(name:, ttl: nil) ⇒ Object



11
12
13
14
# File 'lib/hetzner_dns/models/zone.rb', line 11

def create(name:, ttl: nil)
  response = Client.post_request("zones", body: { name: name, ttl: ttl })
  Zone.new(response.body)
end

.listObject



6
7
8
9
# File 'lib/hetzner_dns/models/zone.rb', line 6

def list
  response = Client.get_request("zones")
  Collection.from_response(response, type: Zone, key: "zones")
end