Class: Doconomy::Api::Transaction
- Defined in:
- lib/doconomy/api/transaction.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#carbon_emission_in_grams ⇒ Object
Returns the value of attribute carbon_emission_in_grams.
-
#carbon_emission_in_ounces ⇒ Object
Returns the value of attribute carbon_emission_in_ounces.
-
#carbon_social_cost ⇒ Object
Returns the value of attribute carbon_social_cost.
-
#category_id ⇒ Object
Returns the value of attribute category_id.
-
#mcc ⇒ Object
Returns the value of attribute mcc.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#water_use_in_cubic_meters ⇒ Object
Returns the value of attribute water_use_in_cubic_meters.
-
#water_use_in_gallons ⇒ Object
Returns the value of attribute water_use_in_gallons.
-
#water_use_social_cost ⇒ Object
Returns the value of attribute water_use_social_cost.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Transaction
constructor
A new instance of Transaction.
Methods inherited from Base
Constructor Details
#initialize(attributes = {}) ⇒ Transaction
Returns a new instance of Transaction.
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/doconomy/api/transaction.rb', line 17 def initialize(attributes = {}) @attributes = attributes.deep_symbolize_keys @reference = @attributes[:reference] @category_id = @attributes[:category_id] @carbon_emission_in_grams = @attributes[:carbon_emission_in_grams] @carbon_emission_in_ounces = @attributes[:carbon_emission_in_ounces] @carbon_social_cost = OpenStruct.new(@attributes[:carbon_social_cost]) if @attributes[:carbon_social_cost] @water_use_in_cubic_meters = @attributes[:water_use_in_cubic_meters] @water_use_in_gallons = @attributes[:water_use_in_gallons] @water_use_social_cost = OpenStruct.new(@attributes[:water_use_social_cost]) if @attributes[:water_use_social_cost] @amount = OpenStruct.new(@attributes[:amount]) if @attributes[:amount] @mcc = @attributes[:mcc] end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
6 7 8 |
# File 'lib/doconomy/api/transaction.rb', line 6 def amount @amount end |
#carbon_emission_in_grams ⇒ Object
Returns the value of attribute carbon_emission_in_grams.
6 7 8 |
# File 'lib/doconomy/api/transaction.rb', line 6 def carbon_emission_in_grams @carbon_emission_in_grams end |
#carbon_emission_in_ounces ⇒ Object
Returns the value of attribute carbon_emission_in_ounces.
6 7 8 |
# File 'lib/doconomy/api/transaction.rb', line 6 def carbon_emission_in_ounces @carbon_emission_in_ounces end |
#carbon_social_cost ⇒ Object
Returns the value of attribute carbon_social_cost.
6 7 8 |
# File 'lib/doconomy/api/transaction.rb', line 6 def @carbon_social_cost end |
#category_id ⇒ Object
Returns the value of attribute category_id.
6 7 8 |
# File 'lib/doconomy/api/transaction.rb', line 6 def category_id @category_id end |
#mcc ⇒ Object
Returns the value of attribute mcc.
6 7 8 |
# File 'lib/doconomy/api/transaction.rb', line 6 def mcc @mcc end |
#reference ⇒ Object
Returns the value of attribute reference.
6 7 8 |
# File 'lib/doconomy/api/transaction.rb', line 6 def reference @reference end |
#water_use_in_cubic_meters ⇒ Object
Returns the value of attribute water_use_in_cubic_meters.
6 7 8 |
# File 'lib/doconomy/api/transaction.rb', line 6 def water_use_in_cubic_meters @water_use_in_cubic_meters end |
#water_use_in_gallons ⇒ Object
Returns the value of attribute water_use_in_gallons.
6 7 8 |
# File 'lib/doconomy/api/transaction.rb', line 6 def water_use_in_gallons @water_use_in_gallons end |
#water_use_social_cost ⇒ Object
Returns the value of attribute water_use_social_cost.
6 7 8 |
# File 'lib/doconomy/api/transaction.rb', line 6 def @water_use_social_cost end |