Class: JwtAuthEngine::SignupService
- Inherits:
-
BaseService
- Object
- BaseService
- JwtAuthEngine::SignupService
- Defined in:
- app/services/jwt_auth_engine/signup_service.rb
Overview
Creates a new auth model record from signup parameters.
Instance Attribute Summary collapse
-
#signup_params ⇒ Object
readonly
Returns the value of attribute signup_params.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(signup_params:) ⇒ SignupService
constructor
A new instance of SignupService.
Methods inherited from BaseService
Constructor Details
#initialize(signup_params:) ⇒ SignupService
Returns a new instance of SignupService.
8 9 10 11 |
# File 'app/services/jwt_auth_engine/signup_service.rb', line 8 def initialize(signup_params:) @signup_params = signup_params super() end |
Instance Attribute Details
#signup_params ⇒ Object (readonly)
Returns the value of attribute signup_params.
6 7 8 |
# File 'app/services/jwt_auth_engine/signup_service.rb', line 6 def signup_params @signup_params end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'app/services/jwt_auth_engine/signup_service.rb', line 13 def call auth_model_instance = JwtAuthEngine.auth_model_class.new(signup_params) if auth_model_instance.save success(JwtAuthEngine.auth_model_name => auth_model_instance) else failure(errors: auth_model_instance.errors.) end end |