Class: Saaz::Configuration
- Inherits:
-
Object
- Object
- Saaz::Configuration
- Defined in:
- lib/saaz/configuration.rb
Instance Attribute Summary collapse
-
#customer_resource_class ⇒ Object
Returns the value of attribute customer_resource_class.
-
#plans ⇒ Object
Returns the value of attribute plans.
-
#publishable_key ⇒ Object
Returns the value of attribute publishable_key.
Instance Method Summary collapse
Instance Attribute Details
#customer_resource_class ⇒ Object
Returns the value of attribute customer_resource_class.
2 3 4 |
# File 'lib/saaz/configuration.rb', line 2 def customer_resource_class @customer_resource_class end |
#plans ⇒ Object
Returns the value of attribute plans.
2 3 4 |
# File 'lib/saaz/configuration.rb', line 2 def plans @plans end |
#publishable_key ⇒ Object
Returns the value of attribute publishable_key.
2 3 4 |
# File 'lib/saaz/configuration.rb', line 2 def publishable_key @publishable_key end |
Instance Method Details
#api_key ⇒ Object
8 9 10 |
# File 'lib/saaz/configuration.rb', line 8 def api_key Stripe.api_key end |
#api_key=(v) ⇒ Object
4 5 6 |
# File 'lib/saaz/configuration.rb', line 4 def api_key=(v) Stripe.api_key = v end |
#find_or_create_plans ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/saaz/configuration.rb', line 20 def find_or_create_plans plans.each do |key, plan_params| begin Stripe::Plan.retrieve(key.to_s) rescue Stripe::InvalidRequestError # Plan does not exist plan_params[:id] ||= key.to_s Stripe::Plan.create plan_params end end end |