Class: Cloudflare::DNS::Record

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

Constant Summary

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

#contentObject



42
43
44
# File 'lib/cloudflare/dns.rb', line 42

def content
	result[:content]
end

#nameObject



38
39
40
# File 'lib/cloudflare/dns.rb', line 38

def name
	result[:name]
end

#proxied?Boolean Also known as: proxied

Returns:

  • (Boolean)


46
47
48
# File 'lib/cloudflare/dns.rb', line 46

def proxied?
	result[:proxied]
end

#to_sObject



52
53
54
# File 'lib/cloudflare/dns.rb', line 52

def to_s
	"#{self.name} #{self.type} #{self.content}"
end

#typeObject



34
35
36
# File 'lib/cloudflare/dns.rb', line 34

def type
	result[:type]
end

#update_content(content, **options) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/cloudflare/dns.rb', line 16

def update_content(content, **options)
	self.class.put(@resource, {
		type: self.type,
		name: self.name,
		content: content,
		**options
	}) do |resource, response|
		if response.success?
			@value = response.read
			@metadata = response.headers
		else
			raise RequestError.new(resource, response.read)
		end
		
		self
	end
end