Class: Rafflesia::SubscriptionSummary

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/billing/subscription_summary.rb

Constant Summary collapse

HASH_ATTRS =
{
  access: :access,
  available_checkout_plans: :available_checkout_plans,
  billing_enabled: :billing_enabled,
  billing_enforced: :billing_enforced,
  can_cancel_pending_switch: :can_cancel_pending_switch,
  can_manage_subscription: :can_manage_subscription,
  can_start_checkout: :can_start_checkout,
  can_switch_plan: :can_switch_plan,
  cancel_at_period_end: :cancel_at_period_end,
  checked_live: :checked_live,
  currency: :currency,
  current_period_end: :current_period_end,
  current_period_end_at: :current_period_end_at,
  current_period_start: :current_period_start,
  customer_id: :customer_id,
  has_subscription_history: :has_subscription_history,
  interval: :interval,
  is_configured: :is_configured,
  organization_id: :organization_id,
  pending_change_date: :pending_change_date,
  pending_plan: :pending_plan,
  plan: :plan,
  plan_id: :plan_id,
  plan_name: :plan_name,
  price_id: :price_id,
  reason: :reason,
  status: :status,
  subscription_id: :subscription_id,
  unit_amount_cents: :unit_amount_cents,
  usage_limit_usd: :usage_limit_usd
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ SubscriptionSummary

Returns a new instance of SubscriptionSummary.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/rafflesia/billing/subscription_summary.rb', line 73

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @access = hash[:access]
  @available_checkout_plans = (hash[:available_checkout_plans] || [])
  @billing_enabled = hash[:billing_enabled]
  @billing_enforced = hash[:billing_enforced]
  @can_cancel_pending_switch = hash[:can_cancel_pending_switch]
  @can_manage_subscription = hash[:can_manage_subscription]
  @can_start_checkout = hash[:can_start_checkout]
  @can_switch_plan = hash[:can_switch_plan]
  @cancel_at_period_end = hash[:cancel_at_period_end]
  @checked_live = hash[:checked_live]
  @currency = hash[:currency]
  @current_period_end = hash[:current_period_end]
  @current_period_end_at = hash[:current_period_end_at]
  @current_period_start = hash[:current_period_start]
  @customer_id = hash[:customer_id]
  @has_subscription_history = hash[:has_subscription_history]
  @interval = hash[:interval]
  @is_configured = hash[:is_configured]
  @organization_id = hash[:organization_id]
  @pending_change_date = hash[:pending_change_date]
  @pending_plan = hash[:pending_plan]
  @plan = hash[:plan]
  @plan_id = hash[:plan_id]
  @plan_name = hash[:plan_name]
  @price_id = hash[:price_id]
  @reason = hash[:reason]
  @status = hash[:status]
  @subscription_id = hash[:subscription_id]
  @unit_amount_cents = hash[:unit_amount_cents]
  @usage_limit_usd = hash[:usage_limit_usd]
end

Instance Attribute Details

#accessObject

Returns the value of attribute access.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def access
  @access
end

#available_checkout_plansObject

Returns the value of attribute available_checkout_plans.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def available_checkout_plans
  @available_checkout_plans
end

#billing_enabledObject

Returns the value of attribute billing_enabled.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def billing_enabled
  @billing_enabled
end

#billing_enforcedObject

Returns the value of attribute billing_enforced.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def billing_enforced
  @billing_enforced
end

#can_cancel_pending_switchObject

Returns the value of attribute can_cancel_pending_switch.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def can_cancel_pending_switch
  @can_cancel_pending_switch
end

#can_manage_subscriptionObject

Returns the value of attribute can_manage_subscription.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def can_manage_subscription
  @can_manage_subscription
end

#can_start_checkoutObject

Returns the value of attribute can_start_checkout.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def can_start_checkout
  @can_start_checkout
end

#can_switch_planObject

Returns the value of attribute can_switch_plan.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def can_switch_plan
  @can_switch_plan
end

#cancel_at_period_endObject

Returns the value of attribute cancel_at_period_end.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def cancel_at_period_end
  @cancel_at_period_end
end

#checked_liveObject

Returns the value of attribute checked_live.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def checked_live
  @checked_live
end

#currencyObject

Returns the value of attribute currency.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def currency
  @currency
end

#current_period_endObject

Returns the value of attribute current_period_end.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def current_period_end
  @current_period_end
end

#current_period_end_atObject

Returns the value of attribute current_period_end_at.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def current_period_end_at
  @current_period_end_at
end

#current_period_startObject

Returns the value of attribute current_period_start.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def current_period_start
  @current_period_start
end

#customer_idObject

Returns the value of attribute customer_id.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def customer_id
  @customer_id
end

#has_subscription_historyObject

Returns the value of attribute has_subscription_history.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def has_subscription_history
  @has_subscription_history
end

#intervalObject

Returns the value of attribute interval.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def interval
  @interval
end

#is_configuredObject

Returns the value of attribute is_configured.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def is_configured
  @is_configured
end

#organization_idObject

Returns the value of attribute organization_id.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def organization_id
  @organization_id
end

#pending_change_dateObject

Returns the value of attribute pending_change_date.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def pending_change_date
  @pending_change_date
end

#pending_planObject

Returns the value of attribute pending_plan.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def pending_plan
  @pending_plan
end

#planObject

Returns the value of attribute plan.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def plan
  @plan
end

#plan_idObject

Returns the value of attribute plan_id.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def plan_id
  @plan_id
end

#plan_nameObject

Returns the value of attribute plan_name.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def plan_name
  @plan_name
end

#price_idObject

Returns the value of attribute price_id.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def price_id
  @price_id
end

#reasonObject

Returns the value of attribute reason.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def reason
  @reason
end

#statusObject

Returns the value of attribute status.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def status
  @status
end

#subscription_idObject

Returns the value of attribute subscription_id.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def subscription_id
  @subscription_id
end

#unit_amount_centsObject

Returns the value of attribute unit_amount_cents.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def unit_amount_cents
  @unit_amount_cents
end

#usage_limit_usdObject

Returns the value of attribute usage_limit_usd.



41
42
43
# File 'lib/rafflesia/billing/subscription_summary.rb', line 41

def usage_limit_usd
  @usage_limit_usd
end