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.
-
#allow_automated_charge_cancellation ⇒ Object
Returns the value of attribute allow_automated_charge_cancellation.
-
#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.
-
#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.
-
#shopify_api_version ⇒ Object
Returns the value of attribute shopify_api_version.
-
#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.
27 28 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 |
# File 'lib/gold/configuration.rb', line 27 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 # Login credential's to Gold's backend @admin_credentials = { user: "admin", password: "password123" } # The API version used by Shopify (https://help.shopify.com/en/api/versioning) @shopify_api_version = "2019-04" # If Gold is allowed to cancel charges (paid -> free) automatically @allow_automated_charge_cancellation = true 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 |
#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_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 |
#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
17 18 19 |
# File 'lib/gold/configuration.rb', line 17 def on_activate_charge @on_activate_charge end |
#on_apply_tier ⇒ Object
Callbacks
17 18 19 |
# File 'lib/gold/configuration.rb', line 17 def on_apply_tier @on_apply_tier end |
#on_check_charge ⇒ Object
Callbacks
17 18 19 |
# File 'lib/gold/configuration.rb', line 17 def on_check_charge @on_check_charge end |
#on_cleanup ⇒ Object
Callbacks
17 18 19 |
# File 'lib/gold/configuration.rb', line 17 def on_cleanup @on_cleanup end |
#on_install ⇒ Object
Callbacks
17 18 19 |
# File 'lib/gold/configuration.rb', line 17 def on_install @on_install end |
#on_terms ⇒ Object
Callbacks
17 18 19 |
# File 'lib/gold/configuration.rb', line 17 def on_terms @on_terms end |
#on_uninstall ⇒ Object
Callbacks
17 18 19 |
# File 'lib/gold/configuration.rb', line 17 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
68 69 70 71 72 73 74 |
# File 'lib/gold/configuration.rb', line 68 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 |
#shopify_api_version ⇒ Object
Returns the value of attribute shopify_api_version.
4 5 6 |
# File 'lib/gold/configuration.rb', line 4 def shopify_api_version @shopify_api_version 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
76 77 78 |
# File 'lib/gold/configuration.rb', line 76 def test_charge? @test_charge end |