Sha256: c0276200a0030f63b8a452bc686aa3fb0cf3dc1417683b17dd7ecd2ffb388031

Contents?: true

Size: 599 Bytes

Versions: 10

Compression:

Stored size: 599 Bytes

Contents

# frozen_string_literal: true

module SolidusBolt
  module Accounts
    class DetectAccountService < SolidusBolt::BaseService
      attr_reader :email

      def initialize(email:)
        @email = email
        super
      end

      def call
        detect_account
      end

      private

      def detect_account
        options = build_options
        handle_result(
          HTTParty.get(
            "#{api_base_url}/#{api_version}/account/exists",
            options
          )
        )
      end

      def build_options
        { query: { email: email } }
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
solidus_bolt-0.7.2 app/services/solidus_bolt/accounts/detect_account_service.rb
solidus_bolt-0.7.1 app/services/solidus_bolt/accounts/detect_account_service.rb
solidus_bolt-0.7.0 app/services/solidus_bolt/accounts/detect_account_service.rb
solidus_bolt-0.6.0 app/services/solidus_bolt/accounts/detect_account_service.rb
solidus_bolt-0.5.0 app/services/solidus_bolt/accounts/detect_account_service.rb
solidus_bolt-0.4.0 app/services/solidus_bolt/accounts/detect_account_service.rb
solidus_bolt-0.3.0 app/services/solidus_bolt/accounts/detect_account_service.rb
solidus_bolt-0.2.0 app/services/solidus_bolt/accounts/detect_account_service.rb
solidus_bolt-0.1.0 app/services/solidus_bolt/accounts/detect_account_service.rb
solidus_bolt-0.0.1 app/services/solidus_bolt/accounts/detect_account_service.rb