Class: Profitable::Processors::Base
- Inherits:
-
Object
- Object
- Profitable::Processors::Base
- Defined in:
- lib/profitable/processors/base.rb
Direct Known Subclasses
BraintreeProcessor, PaddleBillingProcessor, PaddleClassicProcessor, StripeProcessor
Instance Attribute Summary collapse
-
#subscription ⇒ Object
readonly
Returns the value of attribute subscription.
Class Method Summary collapse
-
.subscription_data(subscription) ⇒ Object
Pay gem v10+ stores processor payloads in the ‘object` column, while older versions used `data`.
Instance Method Summary collapse
- #calculate_mrr ⇒ Object
-
#initialize(subscription) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(subscription) ⇒ Base
Returns a new instance of Base.
12 13 14 |
# File 'lib/profitable/processors/base.rb', line 12 def initialize(subscription) @subscription = subscription end |
Instance Attribute Details
#subscription ⇒ Object (readonly)
Returns the value of attribute subscription.
4 5 6 |
# File 'lib/profitable/processors/base.rb', line 4 def subscription @subscription end |
Class Method Details
.subscription_data(subscription) ⇒ Object
Pay gem v10+ stores processor payloads in the ‘object` column, while older versions used `data`. Single source of truth for that fallback.
8 9 10 |
# File 'lib/profitable/processors/base.rb', line 8 def self.subscription_data(subscription) subscription.try(:object) || subscription.try(:data) end |
Instance Method Details
#calculate_mrr ⇒ Object
16 17 18 |
# File 'lib/profitable/processors/base.rb', line 16 def calculate_mrr 0 end |