Class: Clerk::Models::Components::CommerceDiscountRedemptionResponseAmount

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

Overview

How much this discount takes off the subscription item's next renewal charge. Present for either effect when next-payment data is available.

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

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

Constructor Details

#initialize(amount:, amount_formatted:, currency:, currency_symbol:) ⇒ CommerceDiscountRedemptionResponseAmount

Returns a new instance of CommerceDiscountRedemptionResponseAmount.



26
27
28
29
30
31
# File 'lib/clerk/models/components/commercediscountredemptionresponse_amount.rb', line 26

def initialize(amount:, amount_formatted:, currency:, currency_symbol:)
  @amount = amount
  @amount_formatted = amount_formatted
  @currency = currency
  @currency_symbol = currency_symbol
end

Instance Method Details

#==(other) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/clerk/models/components/commercediscountredemptionresponse_amount.rb', line 34

def ==(other)
  return false unless other.is_a? self.class
  return false unless @amount == other.amount
  return false unless @amount_formatted == other.amount_formatted
  return false unless @currency == other.currency
  return false unless @currency_symbol == other.currency_symbol
  true
end