Class: Account::Service::Registration
- Inherits:
-
Object
- Object
- Account::Service::Registration
- Defined in:
- app/models/aikotoba/account/service/registration.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call!(account:) ⇒ Object
-
#initialize(account_class: Account, confirm_service: Account::Service::Confirmation, confirmable: Account.confirmable?) ⇒ Registration
constructor
A new instance of Registration.
Constructor Details
#initialize(account_class: Account, confirm_service: Account::Service::Confirmation, confirmable: Account.confirmable?) ⇒ Registration
Returns a new instance of Registration.
9 10 11 12 13 |
# File 'app/models/aikotoba/account/service/registration.rb', line 9 def initialize(account_class: Account, confirm_service: Account::Service::Confirmation, confirmable: Account.confirmable?) @account_class = account_class @confirm_service = confirm_service @confirmable = confirmable end |
Class Method Details
.call!(account:) ⇒ Object
5 6 7 |
# File 'app/models/aikotoba/account/service/registration.rb', line 5 def self.call!(account:) new.call!(account: account) end |
Instance Method Details
#call!(account:) ⇒ Object
15 16 17 18 19 20 |
# File 'app/models/aikotoba/account/service/registration.rb', line 15 def call!(account:) ActiveRecord::Base.transaction do account.save! send_confirmation_token!(account) if @confirmable end end |