Class: Gold::Configuration
- Inherits:
-
Object
- Object
- Gold::Configuration
- Defined in:
- lib/gold/configuration.rb
Overview
Config for Gold
Instance Attribute Summary collapse
-
#admin_credentials ⇒ Object
Returns the value of attribute admin_credentials.
-
#after_tier_redirect_path ⇒ Object
Returns the value of attribute after_tier_redirect_path.
-
#allow_automated_charge_cancellation ⇒ Object
Returns the value of attribute allow_automated_charge_cancellation.
-
#app_listing_url ⇒ Object
Returns the value of attribute app_listing_url.
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#contact_email ⇒ Object
Returns the value of attribute contact_email.
-
#days_until_cleanup ⇒ Object
Returns the value of attribute days_until_cleanup.
-
#days_until_delinquent ⇒ Object
Returns the value of attribute days_until_delinquent.
-
#force_embedded_redirect ⇒ Object
Returns the value of attribute force_embedded_redirect.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#on_activate_charge ⇒ Object
Callbacks.
-
#on_apply_tier ⇒ Object
Callbacks.
-
#on_check_charge ⇒ Object
Callbacks.
-
#on_cleanup ⇒ Object
Callbacks.
-
#on_install ⇒ Object
Callbacks.
-
#on_terms ⇒ Object
Callbacks.
-
#on_uninstall ⇒ Object
Callbacks.
-
#plan_comparison_url ⇒ Object
Returns the value of attribute plan_comparison_url.
- #shop_class ⇒ Object
-
#shop_domain_attribute ⇒ Object
Returns the value of attribute shop_domain_attribute.
-
#test_charge ⇒ Object
Returns the value of attribute test_charge.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #test_charge? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/gold/configuration.rb', line 29 def initialize # The class name (string) of the the app's Active Record Shop model @shop_class = nil # The attribute of the *.myshopify.com domain on the Shop model @shop_domain_attribute = nil # Should Gold create test charges? Helpful in a development environment @test_charge = false # The logger Gold will use @logger = Logger.new(STDOUT) # How many days we'll wait before cleaning up an uninstalled shop @days_until_cleanup = 30 # How many days we'll wait before we uninstall a shop without payment @days_until_delinquent = 7 # The name of the app using gold (used in the charge name) @app_name = "My App" # The email Gold uses to send emails from @contact_email = nil # The URL to a plan comparison page for the app @plan_comparison_url = nil # Force Gold billing view's to redirect to iframe @force_embedded_redirect = false # Login credential's to Gold's backend @admin_credentials = { user: "admin", password: "password123" } # If Gold is allowed to cancel charges (paid -> free) automatically @allow_automated_charge_cancellation = true # The URL to follow after a referral code is tracked # (e.g. https://apps.shopify.com/customr) @app_listing_url = "https://apps.shopify.com/" # The redirect path after a tier is applied. Use this path to welcome a # merchant if they just installed @after_tier_redirect_path = "/" end |
Instance Attribute Details
#admin_credentials ⇒ Object
Returns the value of attribute admin_credentials.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def admin_credentials @admin_credentials end |
#after_tier_redirect_path ⇒ Object
Returns the value of attribute after_tier_redirect_path.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def after_tier_redirect_path @after_tier_redirect_path end |
#allow_automated_charge_cancellation ⇒ Object
Returns the value of attribute allow_automated_charge_cancellation.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def allow_automated_charge_cancellation @allow_automated_charge_cancellation end |
#app_listing_url ⇒ Object
Returns the value of attribute app_listing_url.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def app_listing_url @app_listing_url end |
#app_name ⇒ Object
Returns the value of attribute app_name.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def app_name @app_name end |
#contact_email ⇒ Object
Returns the value of attribute contact_email.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def contact_email @contact_email end |
#days_until_cleanup ⇒ Object
Returns the value of attribute days_until_cleanup.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def days_until_cleanup @days_until_cleanup end |
#days_until_delinquent ⇒ Object
Returns the value of attribute days_until_delinquent.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def days_until_delinquent @days_until_delinquent end |
#force_embedded_redirect ⇒ Object
Returns the value of attribute force_embedded_redirect.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def @force_embedded_redirect end |
#logger ⇒ Object
Returns the value of attribute logger.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def logger @logger end |
#on_activate_charge ⇒ Object
Callbacks
19 20 21 |
# File 'lib/gold/configuration.rb', line 19 def on_activate_charge @on_activate_charge end |
#on_apply_tier ⇒ Object
Callbacks
19 20 21 |
# File 'lib/gold/configuration.rb', line 19 def on_apply_tier @on_apply_tier end |
#on_check_charge ⇒ Object
Callbacks
19 20 21 |
# File 'lib/gold/configuration.rb', line 19 def on_check_charge @on_check_charge end |
#on_cleanup ⇒ Object
Callbacks
19 20 21 |
# File 'lib/gold/configuration.rb', line 19 def on_cleanup @on_cleanup end |
#on_install ⇒ Object
Callbacks
19 20 21 |
# File 'lib/gold/configuration.rb', line 19 def on_install @on_install end |
#on_terms ⇒ Object
Callbacks
19 20 21 |
# File 'lib/gold/configuration.rb', line 19 def on_terms @on_terms end |
#on_uninstall ⇒ Object
Callbacks
19 20 21 |
# File 'lib/gold/configuration.rb', line 19 def on_uninstall @on_uninstall end |
#plan_comparison_url ⇒ Object
Returns the value of attribute plan_comparison_url.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def plan_comparison_url @plan_comparison_url end |
#shop_class ⇒ Object
78 79 80 81 82 83 84 |
# File 'lib/gold/configuration.rb', line 78 def shop_class @shop_constant ||= @shop_class.to_s.constantize rescue NameError raise "'#{@shop_class}' is not a valid class name for shop class. " \ "You must specify one in your Gold config file with " \ "'config.shop'" end |
#shop_domain_attribute ⇒ Object
Returns the value of attribute shop_domain_attribute.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def shop_domain_attribute @shop_domain_attribute end |
#test_charge ⇒ Object
Returns the value of attribute test_charge.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def test_charge @test_charge end |
Instance Method Details
#test_charge? ⇒ Boolean
86 87 88 |
# File 'lib/gold/configuration.rb', line 86 def test_charge? @test_charge end |