Class: MPI::Services::FindProfileResponseCreator

Inherits:
Object
  • Object
show all
Includes:
SentryLogging
Defined in:
lib/mpi/services/find_profile_response_creator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger

Constructor Details

#initialize(type:, response: nil, error: nil) ⇒ FindProfileResponseCreator

Returns a new instance of FindProfileResponseCreator.



14
15
16
17
18
# File 'lib/mpi/services/find_profile_response_creator.rb', line 14

def initialize(type:, response: nil, error: nil)
  @type = type
  @response = response
  @error = error
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



12
13
14
# File 'lib/mpi/services/find_profile_response_creator.rb', line 12

def error
  @error
end

#responseObject (readonly)

Returns the value of attribute response.



12
13
14
# File 'lib/mpi/services/find_profile_response_creator.rb', line 12

def response
  @response
end

#typeObject (readonly)

Returns the value of attribute type.



12
13
14
# File 'lib/mpi/services/find_profile_response_creator.rb', line 12

def type
  @type
end

Instance Method Details

#performObject



20
21
22
23
24
25
26
27
# File 'lib/mpi/services/find_profile_response_creator.rb', line 20

def perform
  validations
  if error_status
    create_error_response
  else
    create_successful_response
  end
end