Class: SolidusSubscriptions::Configuration
- Inherits:
-
Object
- Object
- SolidusSubscriptions::Configuration
- Defined in:
- lib/solidus_subscriptions/configuration.rb
Instance Attribute Summary collapse
-
#churn_buster_account_id ⇒ Object
Returns the value of attribute churn_buster_account_id.
-
#churn_buster_api_key ⇒ Object
Returns the value of attribute churn_buster_api_key.
-
#clear_past_installments ⇒ Object
Returns the value of attribute clear_past_installments.
- #failure_dispatcher_class ⇒ Object
-
#maximum_reprocessing_time ⇒ Object
Returns the value of attribute maximum_reprocessing_time.
- #maximum_successive_skips ⇒ Object
- #minimum_cancellation_notice ⇒ Object
- #order_creator_class ⇒ Object
-
#out_of_stock_dispatcher ⇒ Object
writeonly
Sets the attribute out_of_stock_dispatcher.
- #payment_failed_dispatcher_class ⇒ Object
- #processing_error_handler ⇒ Object
- #processing_queue ⇒ Object
- #reprocessing_interval ⇒ Object
- #subscribable_class ⇒ Object
- #subscription_attributes ⇒ Object
- #subscription_generator_class ⇒ Object
- #subscription_line_item_attributes ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#churn_buster_account_id ⇒ Object
Returns the value of attribute churn_buster_account_id.
5 6 7 |
# File 'lib/solidus_subscriptions/configuration.rb', line 5 def churn_buster_account_id @churn_buster_account_id end |
#churn_buster_api_key ⇒ Object
Returns the value of attribute churn_buster_api_key.
5 6 7 |
# File 'lib/solidus_subscriptions/configuration.rb', line 5 def churn_buster_api_key @churn_buster_api_key end |
#clear_past_installments ⇒ Object
Returns the value of attribute clear_past_installments.
5 6 7 |
# File 'lib/solidus_subscriptions/configuration.rb', line 5 def clear_past_installments @clear_past_installments end |
#failure_dispatcher_class ⇒ Object
40 41 42 43 |
# File 'lib/solidus_subscriptions/configuration.rb', line 40 def failure_dispatcher_class @failure_dispatcher_class ||= 'SolidusSubscriptions::Dispatcher::FailureDispatcher' @failure_dispatcher_class.constantize end |
#maximum_reprocessing_time ⇒ Object
Returns the value of attribute maximum_reprocessing_time.
5 6 7 |
# File 'lib/solidus_subscriptions/configuration.rb', line 5 def maximum_reprocessing_time @maximum_reprocessing_time end |
#maximum_successive_skips ⇒ Object
60 61 62 |
# File 'lib/solidus_subscriptions/configuration.rb', line 60 def maximum_successive_skips @maximum_successive_skips ||= 1 end |
#minimum_cancellation_notice ⇒ Object
68 69 70 |
# File 'lib/solidus_subscriptions/configuration.rb', line 68 def minimum_cancellation_notice @minimum_cancellation_notice ||= 0.days end |
#order_creator_class ⇒ Object
108 109 110 111 |
# File 'lib/solidus_subscriptions/configuration.rb', line 108 def order_creator_class @order_creator_class ||= 'SolidusSubscriptions::OrderCreator' @order_creator_class.constantize end |
#out_of_stock_dispatcher=(value) ⇒ Object (writeonly)
Sets the attribute out_of_stock_dispatcher
13 14 15 |
# File 'lib/solidus_subscriptions/configuration.rb', line 13 def out_of_stock_dispatcher=(value) @out_of_stock_dispatcher = value end |
#payment_failed_dispatcher_class ⇒ Object
45 46 47 48 |
# File 'lib/solidus_subscriptions/configuration.rb', line 45 def payment_failed_dispatcher_class @payment_failed_dispatcher_class ||= 'SolidusSubscriptions::Dispatcher::PaymentFailedDispatcher' @payment_failed_dispatcher_class.constantize end |
#processing_error_handler ⇒ Object
55 56 57 58 |
# File 'lib/solidus_subscriptions/configuration.rb', line 55 def processing_error_handler @processing_error_handler ||= 'SolidusSubscriptions::ProcessingErrorHandlers::RailsLogger' @processing_error_handler.constantize end |
#processing_queue ⇒ Object
72 73 74 |
# File 'lib/solidus_subscriptions/configuration.rb', line 72 def processing_queue @processing_queue ||= :default end |
#reprocessing_interval ⇒ Object
64 65 66 |
# File 'lib/solidus_subscriptions/configuration.rb', line 64 def reprocessing_interval @reprocessing_interval ||= 1.day end |
#subscribable_class ⇒ Object
99 100 101 102 |
# File 'lib/solidus_subscriptions/configuration.rb', line 99 def subscribable_class @subscribable_class ||= 'Spree::Variant' @subscribable_class.constantize end |
#subscription_attributes ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/solidus_subscriptions/configuration.rb', line 87 def subscription_attributes @subscription_attributes ||= [ :interval_length, :interval_units, :end_date, { shipping_address_attributes: Spree::PermittedAttributes.address_attributes, billing_address_attributes: Spree::PermittedAttributes.address_attributes } ] end |
#subscription_generator_class ⇒ Object
30 31 32 33 |
# File 'lib/solidus_subscriptions/configuration.rb', line 30 def subscription_generator_class @subscription_generator_class ||= 'SolidusSubscriptions::SubscriptionGenerator' @subscription_generator_class.constantize end |
#subscription_line_item_attributes ⇒ Object
76 77 78 79 80 81 82 83 84 85 |
# File 'lib/solidus_subscriptions/configuration.rb', line 76 def subscription_line_item_attributes @subscription_line_item_attributes ||= [ :id, :quantity, :subscribable_id, :interval_length, :interval_units, :end_date ] end |
Instance Method Details
#churn_buster? ⇒ Boolean
104 105 106 |
# File 'lib/solidus_subscriptions/configuration.rb', line 104 def churn_buster? churn_buster_account_id.present? && churn_buster_api_key.present? end |
#out_of_stock_dispatcher_class ⇒ Object
50 51 52 53 |
# File 'lib/solidus_subscriptions/configuration.rb', line 50 def out_of_stock_dispatcher_class @out_of_stock_dispatcher_class ||= 'SolidusSubscriptions::Dispatcher::OutOfStockDispatcher' @out_of_stock_dispatcher_class.constantize end |
#success_dispatcher_class ⇒ Object
35 36 37 38 |
# File 'lib/solidus_subscriptions/configuration.rb', line 35 def success_dispatcher_class @success_dispatcher_class ||= 'SolidusSubscriptions::Dispatcher::SuccessDispatcher' @success_dispatcher_class.constantize end |