app/services/services_base.rb
# Method to validate presence of params
#
# @return [Result::Base]
#
Method to validate presence of params
Method to validate presence of params
def validate
    service_params_list = ServicesBase.get_service_params(self.class.to_s)
    missing_mandatory_params = []
    service_params_list[:mandatory].each do |mandatory_param|
      missing_mandatory_params << mandatory_param if @params[mandatory_param].to_s.blank?
    end if service_params_list[:mandatory].present?
    return error_result('sb_1',
                        'Mandatory params missing.') if missing_mandatory_params.any?
    success_with_data({})
  end
def validate service_params_list = ServicesBase . get_service_params ( self . class . to_s ) missing_mandatory_params = [ ] service_params_list [ :mandatory ] . each do | mandatory_param | missing_mandatory_params << mandatory_param if @params [ mandatory_param ] . to_s . blank? end if service_params_list [ :mandatory ] . present? return error_result ( 'sb_1' , 'Mandatory params missing.' ) if missing_mandatory_params . any? success_with_data ( { } ) end
Method to validate presence of params
Method to validate presence of params
# perform presence related validations here # result object is returned
None
Result::Base