Class: Cloudflare::Zones
Constant Summary
Representation::WRAPPER
Instance Method Summary
collapse
Methods included from Paginate
#each, #empty?, #find_by_id
#errors, #messages, #represent, #represent_message, #result, #results, #success?, #to_hash, #to_id
Instance Method Details
#create(name, account, jump_start: false, **options) ⇒ Object
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
# File 'lib/cloudflare/zones.rb', line 69
def create(name, account, jump_start: false, **options)
payload = {name: name, account: account.to_id, jump_start: jump_start, **options}
Zone.post(@resource, payload) do |resource, response|
value = response.read
result = value[:result]
metadata = response.
if id = result[:id]
resource = resource.with(path: id)
end
Zone.new(resource, value: value, metadata: metadata)
end
end
|
#find_by_name(name) ⇒ Object
85
86
87
|
# File 'lib/cloudflare/zones.rb', line 85
def find_by_name(name)
each(name: name).find{|zone| zone.name == name}
end
|
#representation ⇒ Object
65
66
67
|
# File 'lib/cloudflare/zones.rb', line 65
def representation
Zone
end
|