Method: ShopifyAPI::Auth::Session#initialize
- Defined in:
- lib/shopify_api/auth/session.rb
#initialize(shop:, id: nil, state: nil, access_token: "", scope: [], associated_user_scope: nil, expires: nil, is_online: nil, associated_user: nil, shopify_session_id: nil) ⇒ Session
Returns a new instance of Session.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/shopify_api/auth/session.rb', line 52 def initialize(shop:, id: nil, state: nil, access_token: "", scope: [], associated_user_scope: nil, expires: nil, is_online: nil, associated_user: nil, shopify_session_id: nil) @id = T.let(id || SecureRandom.uuid, String) @shop = shop @state = state @access_token = access_token @scope = T.let(AuthScopes.new(scope), AuthScopes) @associated_user_scope = T.let( associated_user_scope.nil? ? nil : AuthScopes.new(associated_user_scope), T.nilable(AuthScopes) ) @expires = expires @associated_user = associated_user @is_online = T.let(is_online || !associated_user.nil?, T::Boolean) @shopify_session_id = shopify_session_id end |