Class: Tremendous::OrganizationMember
- Inherits:
-
Object
- Object
- Tremendous::OrganizationMember
- Defined in:
- lib/tremendous/organization_member.rb
Class Method Summary collapse
- .create!(organization_id, data) ⇒ Object
- .list(organization_id) ⇒ Object
- .to_path(organization_id) ⇒ Object
Class Method Details
.create!(organization_id, data) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/tremendous/organization_member.rb', line 8 def self.create!(organization_id, data) response = Tremendous::Request.post( to_path(organization_id), body: data.merge(Tremendous.).to_json, headers: { 'Content-Type' => 'application/json' } ) response[:member] end |
.list(organization_id) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/tremendous/organization_member.rb', line 18 def self.list(organization_id) Tremendous::Request.get( to_path(organization_id), query: Tremendous., format: 'json' )[:members] end |
.to_path(organization_id) ⇒ Object
4 5 6 |
# File 'lib/tremendous/organization_member.rb', line 4 def self.to_path(organization_id) "organizations/#{organization_id}/members" end |