Class: Cloudflare::Connection
Instance Method Summary
collapse
#process_response, #represent, #represent_message, #representation, #to_hash
Instance Method Details
#accounts ⇒ Object
52
53
54
|
# File 'lib/cloudflare/connection.rb', line 52
def accounts
self.with(Accounts, path: 'accounts')
end
|
#authenticated(token: nil, key: nil, email: nil) ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/cloudflare/connection.rb', line 31
def authenticated(token: nil, key: nil, email: nil)
= {}
if token
['Authorization'] = "Bearer #{token}"
elsif key
if email
['X-Auth-Key'] = key
['X-Auth-Email'] = email
else
['X-Auth-User-Service-Key'] = key
end
end
self.with(headers: )
end
|
#user ⇒ Object
56
57
58
|
# File 'lib/cloudflare/connection.rb', line 56
def user
self.with(User, path: 'user')
end
|
#zones ⇒ Object
48
49
50
|
# File 'lib/cloudflare/connection.rb', line 48
def zones
self.with(Zones, path: 'zones')
end
|