class Arpa::Services::Profiles::Update::ProfileUpdater
Public Instance Methods
update(params)
click to toggle source
# File lib/arpa/services/profiles/update/profile_updater.rb, line 6 def update(params) profile = profile_instance(params) validate_profile(profile) updater_repo.update(profile) end
Private Instance Methods
profile_instance(params)
click to toggle source
# File lib/arpa/services/profiles/update/profile_updater.rb, line 14 def profile_instance(params) Arpa::Entities::Profile.new(params) end
updater_repo()
click to toggle source
# File lib/arpa/services/profiles/update/profile_updater.rb, line 23 def updater_repo @updater_repo ||= Arpa::Repositories::Profiles::Updater.new end
validate_profile(profile)
click to toggle source
# File lib/arpa/services/profiles/update/profile_updater.rb, line 18 def validate_profile(profile) validator = Arpa::Validators::ProfileValidator.new(profile) raise Arpa::Exceptions::RecordInvalid.new(message: validator.errors.messages, errors: validator.errors) unless validator.valid? end