Class: Monban::Services::SignUp

Inherits:
Object
  • Object
show all
Defined in:
lib/monban/services/sign_up.rb

Overview

Sign up service. Signs the user up

Since:

  • 0.0.15

Instance Method Summary collapse

Constructor Details

#initialize(user_params) ⇒ SignUp

Initialize service

Parameters:

  • user_params (Hash)

    A hash of user credentials. Should contain the lookup and token fields

Since:

  • 0.0.15



9
10
11
12
13
14
# File 'lib/monban/services/sign_up.rb', line 9

def initialize user_params
  digested_token = token_digest(user_params)
  @user_params = user_params.
    except(token_field).
    merge(token_store_field.to_sym => digested_token)
end

Instance Method Details

#performObject

Performs the service

See Also:

  • Configuration.default_creation_method

Since:

  • 0.0.15



18
19
20
# File 'lib/monban/services/sign_up.rb', line 18

def perform
  Monban.config.creation_method.call(user_params)
end