Class: ShopifyApp::OmniAuthConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_shopify_app/omniauth/omniauth_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(strategy, request) ⇒ OmniAuthConfiguration

Returns a new instance of OmniAuthConfiguration.



8
9
10
11
# File 'lib/ruby_shopify_app/omniauth/omniauth_configuration.rb', line 8

def initialize(strategy, request)
  @strategy = strategy
  @request = request
end

Instance Attribute Details

#client_options_site=(value) ⇒ Object

Sets the attribute client_options_site

Parameters:

  • value

    the value to set the attribute client_options_site to.



6
7
8
# File 'lib/ruby_shopify_app/omniauth/omniauth_configuration.rb', line 6

def client_options_site=(value)
  @client_options_site = value
end

#per_user_permissions=(value) ⇒ Object (writeonly)

Sets the attribute per_user_permissions

Parameters:

  • value

    the value to set the attribute per_user_permissions to.



6
7
8
# File 'lib/ruby_shopify_app/omniauth/omniauth_configuration.rb', line 6

def per_user_permissions=(value)
  @per_user_permissions = value
end

#requestObject (readonly)

Returns the value of attribute request.



5
6
7
# File 'lib/ruby_shopify_app/omniauth/omniauth_configuration.rb', line 5

def request
  @request
end

#scopes=(value) ⇒ Object

Sets the attribute scopes

Parameters:

  • value

    the value to set the attribute scopes to.



6
7
8
# File 'lib/ruby_shopify_app/omniauth/omniauth_configuration.rb', line 6

def scopes=(value)
  @scopes = value
end

#strategyObject (readonly)

Returns the value of attribute strategy.



5
6
7
# File 'lib/ruby_shopify_app/omniauth/omniauth_configuration.rb', line 5

def strategy
  @strategy
end

Instance Method Details

#build_optionsObject



13
14
15
16
17
18
# File 'lib/ruby_shopify_app/omniauth/omniauth_configuration.rb', line 13

def build_options
  strategy.options[:client_options][:site] = client_options_site
  strategy.options[:scope] = scopes
  strategy.options[:old_client_secret] = ShopifyApp.configuration.old_secret
  strategy.options[:per_user_permissions] = request_online_tokens?
end