Class: Cloudflare::Zone

Inherits:
Representation show all
Defined in:
lib/cloudflare/zones.rb

Constant Summary collapse

DEFAULT_PURGE_CACHE_PARAMS =
{
	purge_everything: true
}.freeze

Instance Method Summary collapse

Methods inherited from Representation

#process_response, #represent, #represent_message, #representation, #to_hash

Instance Method Details

#custom_hostnamesObject



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

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

#dns_recordsObject



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

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

#firewall_rulesObject



43
44
45
# File 'lib/cloudflare/zones.rb', line 43

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

#logsObject



47
48
49
# File 'lib/cloudflare/zones.rb', line 47

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

#nameObject Also known as: to_s



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

def name
	value[:name]
end

#purge_cache(parameters = DEFAULT_PURGE_CACHE_PARAMS) ⇒ Object



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

def purge_cache(parameters = DEFAULT_PURGE_CACHE_PARAMS)
	self.with(Zone, path: 'purge_cache').post(parameters)
	
	return self
end