Class: Ecologi::CarbonOffsetsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/ecologi/resources/carbon_offsets.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

#purchase(number:, units:) ⇒ Object



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

def purchase(number:, units:)
  response = post_request("impact/carbon", body: {number: number, units: units})
  CarbonOffsetPurchase.new response.body
end