Class: CloudflareClient::Organization
- Inherits:
-
CloudflareClient
- Object
- CloudflareClient
- CloudflareClient::Organization
- Defined in:
- lib/cloudflare_client/organization.rb
Direct Known Subclasses
Defined Under Namespace
Classes: AccessRule, Invite, Member, Railgun, Role
Constant Summary
Constants inherited from CloudflareClient
API_BASE, POSSIBLE_API_SETTINGS, VALID_BUNDLE_METHODS, VALID_DIRECTIONS, VALID_MATCHES, VERSION
Instance Attribute Summary collapse
-
#org_id ⇒ Object
readonly
Returns the value of attribute org_id.
Instance Method Summary collapse
-
#initialize(args) ⇒ Organization
constructor
Organization based operations.
-
#show ⇒ Object
get an org’s details.
-
#update(name: nil) ⇒ Object
update a given org (only supports name).
Constructor Details
#initialize(args) ⇒ Organization
Organization based operations
8 9 10 11 12 |
# File 'lib/cloudflare_client/organization.rb', line 8 def initialize(args) @org_id = args.delete(:org_id) id_check(:org_id, org_id) super(**args) end |
Instance Attribute Details
#org_id ⇒ Object (readonly)
Returns the value of attribute org_id.
4 5 6 |
# File 'lib/cloudflare_client/organization.rb', line 4 def org_id @org_id end |
Instance Method Details
#show ⇒ Object
get an org’s details
16 17 18 |
# File 'lib/cloudflare_client/organization.rb', line 16 def show cf_get(path: "/organizations/#{org_id}") end |
#update(name: nil) ⇒ Object
update a given org (only supports name)
22 23 24 25 |
# File 'lib/cloudflare_client/organization.rb', line 22 def update(name: nil) data = name.nil? ? {} : {name: name} cf_patch(path: "/organizations/#{org_id}", data: data) end |