Class: Lago::Api::Resources::Group

Inherits:
Base
  • Object
show all
Defined in:
lib/lago/api/resources/group.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#create, #destroy, #get, #initialize, #update, #whitelist_params

Constructor Details

This class inherits a constructor from Lago::Api::Resources::Base

Instance Method Details

#api_resourceObject



7
8
9
# File 'lib/lago/api/resources/group.rb', line 7

def api_resource
  'groups'
end

#get_all(code, options = {}) ⇒ Object



15
16
17
18
19
20
# File 'lib/lago/api/resources/group.rb', line 15

def get_all(code, options = {})
  path = "/api/v1/billable_metrics/#{code}/groups"
  response = connection.get_all(options, path)

  JSON.parse(response.to_json, object_class: OpenStruct)
end

#root_nameObject



11
12
13
# File 'lib/lago/api/resources/group.rb', line 11

def root_name
  'group'
end