Class: Services::CreateSltcRegistrationContext
- Inherits:
-
Object
- Object
- Services::CreateSltcRegistrationContext
- Defined in:
- app/contexts/services/create_sltc_registration_context.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(params) ⇒ CreateSltcRegistrationContext
constructor
A new instance of CreateSltcRegistrationContext.
Constructor Details
#initialize(params) ⇒ CreateSltcRegistrationContext
Returns a new instance of CreateSltcRegistrationContext.
11 12 13 14 |
# File 'app/contexts/services/create_sltc_registration_context.rb', line 11 def initialize(params) @params = params self.extend Services::SltcRegistrationSaver end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'app/contexts/services/create_sltc_registration_context.rb', line 5 def params @params end |
Class Method Details
.call(params) ⇒ Object
7 8 9 |
# File 'app/contexts/services/create_sltc_registration_context.rb', line 7 def self.call(params) CreateSltcRegistrationContext.new(params).call end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 |
# File 'app/contexts/services/create_sltc_registration_context.rb', line 16 def call save_registration(params).tap do | registration | NotifyNewRegistrationContext.call(registration) if registration.errors.blank? end end |