Class: Clerk::Models::Components::CommerceSubscription

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

Overview

A commerce subscription.

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

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

Constructor Details

#initialize(object:, id:, instance_id:, status:, payer_id:, created_at:, updated_at:, subscription_items:, active_at: nil, past_due_at: nil, next_payment: nil, eligible_for_free_trial: nil) ⇒ CommerceSubscription

Returns a new instance of CommerceSubscription.



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

def initialize(object:, id:, instance_id:, status:, payer_id:, created_at:, updated_at:, subscription_items:, active_at: nil, past_due_at: nil, next_payment: nil, eligible_for_free_trial: nil)
  @object = object
  @id = id
  @instance_id = instance_id
  @status = status
  @payer_id = payer_id
  @created_at = created_at
  @updated_at = updated_at
  @subscription_items = subscription_items
  @active_at = active_at
  @past_due_at = past_due_at
  @next_payment = next_payment
  @eligible_for_free_trial = eligible_for_free_trial
end

Instance Method Details

#==(other) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/clerk/models/components/commercesubscription.rb', line 57

def ==(other)
  return false unless other.is_a? self.class
  return false unless @object == other.object
  return false unless @id == other.id
  return false unless @instance_id == other.instance_id
  return false unless @status == other.status
  return false unless @payer_id == other.payer_id
  return false unless @created_at == other.created_at
  return false unless @updated_at == other.updated_at
  return false unless @subscription_items == other.subscription_items
  return false unless @active_at == other.active_at
  return false unless @past_due_at == other.past_due_at
  return false unless @next_payment == other.next_payment
  return false unless @eligible_for_free_trial == other.eligible_for_free_trial
  true
end