Class: Ecologi::ReportingResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/ecologi/resources/reporting.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Ecologi::Resource

Instance Method Details

#total_carbon(username:) ⇒ Object



14
15
16
17
# File 'lib/ecologi/resources/reporting.rb', line 14

def total_carbon(username:)
  response = get_request("users/#{username}/carbon-offset")
  Report.new response.body
end

#total_impact(username:) ⇒ Object



4
5
6
7
# File 'lib/ecologi/resources/reporting.rb', line 4

def total_impact(username:)
  response = get_request("users/#{username}/impact")
  Report.new response.body
end

#total_trees(username:) ⇒ Object



9
10
11
12
# File 'lib/ecologi/resources/reporting.rb', line 9

def total_trees(username:)
  response = get_request("users/#{username}/trees")
  Report.new response.body
end