Class: Saaz::Subscription
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Saaz::Subscription
- Includes:
- StripeObject
- Defined in:
- app/models/saaz/subscription.rb
Instance Attribute Summary collapse
-
#plan_id ⇒ Object
Returns the value of attribute plan_id.
Instance Method Summary collapse
Methods included from StripeObject
#delegate_all_to_stripe, #delegate_getter, #delegate_setter, #delegate_to_stripe, #method_missing, #stripe_dirty, #update_stripe
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Saaz::StripeObject
Instance Attribute Details
#plan_id ⇒ Object
Returns the value of attribute plan_id.
4 5 6 |
# File 'app/models/saaz/subscription.rb', line 4 def plan_id @plan_id end |
Instance Method Details
#cancel_stripe ⇒ Object
29 30 31 |
# File 'app/models/saaz/subscription.rb', line 29 def cancel_stripe to_stripe.delete(at_period_end: true) end |
#to_stripe ⇒ Object
13 14 15 |
# File 'app/models/saaz/subscription.rb', line 13 def to_stripe @stripe_instance ||= to_stripe_uncached end |
#to_stripe_uncached ⇒ Object
17 18 19 20 21 |
# File 'app/models/saaz/subscription.rb', line 17 def to_stripe_uncached retval = customer.to_stripe.subscriptions.retrieve(stripe_id) delegate_all_to_stripe(retval) retval end |