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

#activation_check ⇒ Object



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

def activation_check
	self.class.put(@resource.with(path: "activation_check"))
end

#custom_hostnames ⇒ Object



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

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

#dns_records ⇒ Object



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

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

#firewall_rules ⇒ Object



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

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

#logs ⇒ Object



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

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

#name ⇒ Object Also known as: to_s



60
61
62
# File 'lib/cloudflare/zones.rb', line 60

def name
	result[:name]
end

#purge_cache(**options) ⇒ Object



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

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