Class: Clerk::Models::Components::CommerceSubscriptionItemTotals

Inherits:
Object
  • Object
show all
Includes:
Crystalline::MetadataFields
Defined in:
lib/clerk/models/components/commercesubscriptionitem_totals.rb

Overview

Totals for this subscription item.

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

#field, #fields, included, #marshal_single, #to_dict, #to_json

Constructor Details

#initialize(subtotal:, base_fee:, tax_total:, grand_total:, per_unit_totals: nil, credits: nil, discounts: nil) ⇒ CommerceSubscriptionItemTotals

Returns a new instance of CommerceSubscriptionItemTotals.



31
32
33
34
35
36
37
38
39
# File 'lib/clerk/models/components/commercesubscriptionitem_totals.rb', line 31

def initialize(subtotal:, base_fee:, tax_total:, grand_total:, per_unit_totals: nil, credits: nil, discounts: nil)
  @subtotal = subtotal
  @base_fee = base_fee
  @tax_total = tax_total
  @grand_total = grand_total
  @per_unit_totals = per_unit_totals
  @credits = credits
  @discounts = discounts
end

Instance Method Details

#==(other) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/clerk/models/components/commercesubscriptionitem_totals.rb', line 42

def ==(other)
  return false unless other.is_a? self.class
  return false unless @subtotal == other.subtotal
  return false unless @base_fee == other.base_fee
  return false unless @tax_total == other.tax_total
  return false unless @grand_total == other.grand_total
  return false unless @per_unit_totals == other.per_unit_totals
  return false unless @credits == other.credits
  return false unless @discounts == other.discounts
  true
end