Class: Organization::OrganizationResource
- Inherits:
-
Object
- Object
- Organization::OrganizationResource
show all
- Includes:
- Request
- Defined in:
- lib/tremendous/organization.rb
Instance Method Summary
collapse
Methods included from Request
#_execute, #access_token, #delete, #get, #handle_response, #initialize, #post, #put, #uri, #url
Instance Method Details
#create!(data) ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/tremendous/organization.rb', line 16
def create!(data)
post(
'organizations',
body: data.to_json,
headers: { 'Content-Type' => 'application/json' }
)[:organization]
end
|
#create_access_token!(id, data = {}) ⇒ Object
28
29
30
31
32
33
34
|
# File 'lib/tremendous/organization.rb', line 28
def create_access_token!(id, data={})
post(
"organizations/#{id}/access_token",
body: data.to_json,
headers: { 'Content-Type' => 'application/json' }
)[:access_token]
end
|
#list(filters = {}) ⇒ Object
24
25
26
|
# File 'lib/tremendous/organization.rb', line 24
def list(filters={})
get('organizations', query: filters)[:organizations]
end
|