Class: Tremendous::Organization

Inherits:
Object
  • Object
show all
Defined in:
lib/tremendous/organization.rb

Class Method Summary collapse

Class Method Details

.create!(data) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/tremendous/organization.rb', line 4

def self.create!(data)
  response = Tremendous::Request.post(
    'organizations',
    body: data.merge(Tremendous.default_options).to_json,
    headers: { 'Content-Type' => 'application/json' }
  )

  response[:organization]
end

.listObject



14
15
16
17
18
19
20
# File 'lib/tremendous/organization.rb', line 14

def self.list
  Tremendous::Request.get(
    'organizations',
    query: Tremendous.default_options,
    format: 'json'
  )[:organizations]
end