Class: Effective::Subscription
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::Subscription
- Defined in:
- app/models/effective/subscription.rb
Instance Attribute Summary collapse
-
#stripe_subscription ⇒ Object
Returns the value of attribute stripe_subscription.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #active? ⇒ Boolean
- #canceled? ⇒ Boolean
- #past_due? ⇒ Boolean
- #plan ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#stripe_subscription ⇒ Object
Returns the value of attribute stripe_subscription.
5 6 7 |
# File 'app/models/effective/subscription.rb', line 5 def stripe_subscription @stripe_subscription end |
Instance Method Details
#<=>(other) ⇒ Object
72 73 74 |
# File 'app/models/effective/subscription.rb', line 72 def <=>(other) name.to_s <=> other&.name.to_s end |
#active? ⇒ Boolean
76 77 78 |
# File 'app/models/effective/subscription.rb', line 76 def active? status == 'active' end |
#canceled? ⇒ Boolean
84 85 86 |
# File 'app/models/effective/subscription.rb', line 84 def canceled? status == 'canceled' end |
#past_due? ⇒ Boolean
80 81 82 |
# File 'app/models/effective/subscription.rb', line 80 def past_due? status == 'past_due' end |
#plan ⇒ Object
61 62 63 |
# File 'app/models/effective/subscription.rb', line 61 def plan EffectiveOrders.stripe_plans[stripe_plan_id] end |
#to_s ⇒ Object
57 58 59 |
# File 'app/models/effective/subscription.rb', line 57 def to_s name || 'New Subscription' end |