Class: SolidusSubscriptions::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/solidus_subscriptions/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#churn_buster_account_idObject

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
end

#churn_buster_api_keyObject

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_installmentsObject

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_classObject



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_timeObject

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_skipsObject



60
61
62
# File 'lib/solidus_subscriptions/configuration.rb', line 60

def maximum_successive_skips
  @maximum_successive_skips ||= 1
end

#minimum_cancellation_noticeObject



68
69
70
# File 'lib/solidus_subscriptions/configuration.rb', line 68

def minimum_cancellation_notice
  @minimum_cancellation_notice ||= 0.days
end

#order_creator_classObject



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

Parameters:

  • value

    the value to set the attribute out_of_stock_dispatcher to.



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_classObject



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_handlerObject



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_queueObject



72
73
74
# File 'lib/solidus_subscriptions/configuration.rb', line 72

def processing_queue
  @processing_queue ||= :default
end

#reprocessing_intervalObject



64
65
66
# File 'lib/solidus_subscriptions/configuration.rb', line 64

def reprocessing_interval
  @reprocessing_interval ||= 1.day
end

#subscribable_classObject



99
100
101
102
# File 'lib/solidus_subscriptions/configuration.rb', line 99

def subscribable_class
  @subscribable_class ||= 'Spree::Variant'
  @subscribable_class.constantize
end

#subscription_attributesObject



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_classObject



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_attributesObject



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

Returns:

  • (Boolean)


104
105
106
# File 'lib/solidus_subscriptions/configuration.rb', line 104

def churn_buster?
  .present? && churn_buster_api_key.present?
end

#out_of_stock_dispatcher_classObject



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_classObject



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