Class: Cloudflare::Zone

Inherits:
Representation show all
Includes:
Async::REST::Representation::Mutable
Defined in:
lib/cloudflare/zones.rb

Constant Summary collapse

DEFAULT_PURGE_CACHE_PARAMETERS =
{
	purge_everything: true
}.freeze

Constants inherited from Representation

Representation::WRAPPER

Instance Method Summary collapse

Methods inherited from Representation

#errors, #messages, #represent, #represent_message, #representation, #result, #results, #success?, #to_hash, #to_id

Instance Method Details

#custom_hostnamesObject



27
28
29
# File 'lib/cloudflare/zones.rb', line 27

def custom_hostnames
	self.with(CustomHostnames, path: "custom_hostnames")
end

#dns_recordsObject



31
32
33
# File 'lib/cloudflare/zones.rb', line 31

def dns_records
	self.with(DNS::Records, path: "dns_records")
end

#firewall_rulesObject



35
36
37
# File 'lib/cloudflare/zones.rb', line 35

def firewall_rules
	self.with(Firewall::Rules, path: "firewall/access_rules/rules")
end

#logsObject



39
40
41
# File 'lib/cloudflare/zones.rb', line 39

def logs
	self.with(Logs::Received, path: "logs/received")
end

#nameObject Also known as: to_s



55
56
57
# File 'lib/cloudflare/zones.rb', line 55

def name
	result[:name]
end

#purge_cache(**options) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/cloudflare/zones.rb', line 47

def purge_cache(**options)
	if options.empty?
		options = DEFAULT_PURGE_CACHE_PARAMETERS
	end
	
	self.class.post(@resource.with(path: "purge_cache"), options)
end