Class: CFC::Zone

Inherits:
APIObject show all
Defined in:
lib/cfc/objects/zone.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIObject

#initialize, #inspect, #method_missing, opts, relationship, #respond_to_missing?

Constructor Details

This class inherits a constructor from CFC::APIObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CFC::APIObject

Class Method Details

.listObject



13
14
15
16
# File 'lib/cfc/objects/zone.rb', line 13

def self.list
  data = @api.get_json('zones')['result']
  data.map { |z| new(z) }
end

Instance Method Details

#purge_all_filesObject



18
19
20
# File 'lib/cfc/objects/zone.rb', line 18

def purge_all_files
  @api.post_to_json("zones/#{id}/purge_cache", { purge_everything: true })
end

#recordsObject



22
23
24
25
# File 'lib/cfc/objects/zone.rb', line 22

def records
  data = @api.get_json("zones/#{id}/dns_records")['result']
  data.map { |r| CFC::Record.new(r) }
end