Class: ShopifyApp::Configuration
- Inherits:
-
Object
- Object
- ShopifyApp::Configuration
- Defined in:
- lib/ruby_shopify_app/configuration.rb
Instance Attribute Summary collapse
-
#after_authenticate_job ⇒ Object
Returns the value of attribute after_authenticate_job.
-
#allow_cookie_authentication ⇒ Object
Returns the value of attribute allow_cookie_authentication.
-
#allow_jwt_authentication ⇒ Object
allow enabling jwt headers for authentication.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#application_name ⇒ Object
Shopify App settings.
-
#disable_webpacker ⇒ Object
ability to have webpacker installed but not used in this gem and the generators.
-
#embedded_app ⇒ Object
(also: #embedded_app?)
Returns the value of attribute embedded_app.
- #enable_same_site_none ⇒ Object
- #login_url ⇒ Object
-
#myshopify_domain ⇒ Object
configure myshopify domain for local shopify development.
-
#old_secret ⇒ Object
Returns the value of attribute old_secret.
-
#reauth_on_access_scope_changes ⇒ Object
Returns the value of attribute reauth_on_access_scope_changes.
-
#root_url ⇒ Object
customise urls.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#scripttags ⇒ Object
Returns the value of attribute scripttags.
-
#scripttags_manager_queue_name ⇒ Object
customise ActiveJob queue names.
-
#secret ⇒ Object
Returns the value of attribute secret.
- #shop_access_scopes ⇒ Object
- #user_access_scopes ⇒ Object
-
#webhook_jobs_namespace ⇒ Object
allow namespacing webhook jobs.
-
#webhooks ⇒ Object
Returns the value of attribute webhooks.
-
#webhooks_manager_queue_name ⇒ Object
Returns the value of attribute webhooks_manager_queue_name.
Instance Method Summary collapse
- #has_scripttags? ⇒ Boolean
- #has_webhooks? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #shop_access_scopes_strategy ⇒ Object
- #shop_session_repository ⇒ Object
- #shop_session_repository=(klass) ⇒ Object
- #user_access_scopes_strategy ⇒ Object
- #user_session_repository ⇒ Object
- #user_session_repository=(klass) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
48 49 50 51 52 53 54 55 |
# File 'lib/ruby_shopify_app/configuration.rb', line 48 def initialize @root_url = '/' @myshopify_domain = 'myshopify.com' @scripttags_manager_queue_name = Rails.application.config.active_job.queue_name @webhooks_manager_queue_name = Rails.application.config.active_job.queue_name @disable_webpacker = ENV['SHOPIFY_APP_DISABLE_WEBPACKER'].present? @allow_cookie_authentication = true end |
Instance Attribute Details
#after_authenticate_job ⇒ Object
Returns the value of attribute after_authenticate_job.
18 19 20 |
# File 'lib/ruby_shopify_app/configuration.rb', line 18 def after_authenticate_job @after_authenticate_job end |
#allow_cookie_authentication ⇒ Object
Returns the value of attribute allow_cookie_authentication.
46 47 48 |
# File 'lib/ruby_shopify_app/configuration.rb', line 46 def @allow_cookie_authentication end |
#allow_jwt_authentication ⇒ Object
allow enabling jwt headers for authentication
44 45 46 |
# File 'lib/ruby_shopify_app/configuration.rb', line 44 def allow_jwt_authentication @allow_jwt_authentication end |
#api_key ⇒ Object
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/ruby_shopify_app/configuration.rb', line 8 def api_key @api_key end |
#api_version ⇒ Object
Returns the value of attribute api_version.
19 20 21 |
# File 'lib/ruby_shopify_app/configuration.rb', line 19 def api_version @api_version end |
#application_name ⇒ Object
Shopify App settings. These values should match the configuration for the app in your Shopify Partners page. Change your settings in ‘config/initializers/shopify_app.rb`
7 8 9 |
# File 'lib/ruby_shopify_app/configuration.rb', line 7 def application_name @application_name end |
#disable_webpacker ⇒ Object
ability to have webpacker installed but not used in this gem and the generators
35 36 37 |
# File 'lib/ruby_shopify_app/configuration.rb', line 35 def disable_webpacker @disable_webpacker end |
#embedded_app ⇒ Object Also known as: embedded_app?
Returns the value of attribute embedded_app.
14 15 16 |
# File 'lib/ruby_shopify_app/configuration.rb', line 14 def @embedded_app end |
#enable_same_site_none ⇒ Object
95 96 97 |
# File 'lib/ruby_shopify_app/configuration.rb', line 95 def enable_same_site_none !Rails.env.test? && (@enable_same_site_none.nil? ? : @enable_same_site_none) end |
#login_url ⇒ Object
57 58 59 |
# File 'lib/ruby_shopify_app/configuration.rb', line 57 def login_url @login_url || File.join(@root_url, 'login') end |
#myshopify_domain ⇒ Object
configure myshopify domain for local shopify development
32 33 34 |
# File 'lib/ruby_shopify_app/configuration.rb', line 32 def myshopify_domain @myshopify_domain end |
#old_secret ⇒ Object
Returns the value of attribute old_secret.
10 11 12 |
# File 'lib/ruby_shopify_app/configuration.rb', line 10 def old_secret @old_secret end |
#reauth_on_access_scope_changes ⇒ Object
Returns the value of attribute reauth_on_access_scope_changes.
21 22 23 |
# File 'lib/ruby_shopify_app/configuration.rb', line 21 def reauth_on_access_scope_changes @reauth_on_access_scope_changes end |
#root_url ⇒ Object
customise urls
24 25 26 |
# File 'lib/ruby_shopify_app/configuration.rb', line 24 def root_url @root_url end |
#scope ⇒ Object
Returns the value of attribute scope.
11 12 13 |
# File 'lib/ruby_shopify_app/configuration.rb', line 11 def scope @scope end |
#scripttags ⇒ Object
Returns the value of attribute scripttags.
17 18 19 |
# File 'lib/ruby_shopify_app/configuration.rb', line 17 def @scripttags end |
#scripttags_manager_queue_name ⇒ Object
customise ActiveJob queue names
28 29 30 |
# File 'lib/ruby_shopify_app/configuration.rb', line 28 def @scripttags_manager_queue_name end |
#secret ⇒ Object
Returns the value of attribute secret.
9 10 11 |
# File 'lib/ruby_shopify_app/configuration.rb', line 9 def secret @secret end |
#shop_access_scopes ⇒ Object
99 100 101 |
# File 'lib/ruby_shopify_app/configuration.rb', line 99 def shop_access_scopes @shop_access_scopes || scope end |
#user_access_scopes ⇒ Object
103 104 105 |
# File 'lib/ruby_shopify_app/configuration.rb', line 103 def user_access_scopes @user_access_scopes || scope end |
#webhook_jobs_namespace ⇒ Object
allow namespacing webhook jobs
38 39 40 |
# File 'lib/ruby_shopify_app/configuration.rb', line 38 def webhook_jobs_namespace @webhook_jobs_namespace end |
#webhooks ⇒ Object
Returns the value of attribute webhooks.
16 17 18 |
# File 'lib/ruby_shopify_app/configuration.rb', line 16 def webhooks @webhooks end |
#webhooks_manager_queue_name ⇒ Object
Returns the value of attribute webhooks_manager_queue_name.
29 30 31 |
# File 'lib/ruby_shopify_app/configuration.rb', line 29 def webhooks_manager_queue_name @webhooks_manager_queue_name end |
Instance Method Details
#has_scripttags? ⇒ Boolean
91 92 93 |
# File 'lib/ruby_shopify_app/configuration.rb', line 91 def .present? end |
#has_webhooks? ⇒ Boolean
87 88 89 |
# File 'lib/ruby_shopify_app/configuration.rb', line 87 def has_webhooks? webhooks.present? end |
#shop_access_scopes_strategy ⇒ Object
77 78 79 80 |
# File 'lib/ruby_shopify_app/configuration.rb', line 77 def shop_access_scopes_strategy return ShopifyApp::AccessScopes::NoopStrategy unless reauth_on_access_scope_changes ShopifyApp::AccessScopes::ShopStrategy end |
#shop_session_repository ⇒ Object
73 74 75 |
# File 'lib/ruby_shopify_app/configuration.rb', line 73 def shop_session_repository ShopifyApp::SessionRepository.shop_storage end |
#shop_session_repository=(klass) ⇒ Object
69 70 71 |
# File 'lib/ruby_shopify_app/configuration.rb', line 69 def shop_session_repository=(klass) ShopifyApp::SessionRepository.shop_storage = klass end |
#user_access_scopes_strategy ⇒ Object
82 83 84 85 |
# File 'lib/ruby_shopify_app/configuration.rb', line 82 def user_access_scopes_strategy return ShopifyApp::AccessScopes::NoopStrategy unless reauth_on_access_scope_changes ShopifyApp::AccessScopes::UserStrategy end |
#user_session_repository ⇒ Object
65 66 67 |
# File 'lib/ruby_shopify_app/configuration.rb', line 65 def user_session_repository ShopifyApp::SessionRepository.user_storage end |
#user_session_repository=(klass) ⇒ Object
61 62 63 |
# File 'lib/ruby_shopify_app/configuration.rb', line 61 def user_session_repository=(klass) ShopifyApp::SessionRepository.user_storage = klass end |