lib/neutrino/gateway/uri/whitelist_factory.rb
# Builds a Whitelist, making decisions from values specified in the whitelist Hash
#
# @return [Whitelist] the constructed Whitelist
Builds a Whitelist, making decisions from values specified in the whitelist Hash
Builds a Whitelist making decisions from values specified in the whitelist Hash
def build
          fail Neutrino::Gateway::Exceptions::BadRequestError if @specified_whitelists.count > 1
          whitelist = @specified_whitelists.first
          values = @whitelist_hash[whitelist]
          case whitelist
          when :type_of_service_whitelist
            Whitelist.new
                     .with_template('/type_of_service_list/{value}')
                     .and_values(values)
                     .error_on_empty(Neutrino::Gateway::Exceptions::TypesOfServiceNotProvided)
          when :subject_matter_domain_whitelist
            Whitelist.new
                     .with_template('/subject_matter_domain_list/{value}')
                     .and_values(values)
                     .error_on_empty(Neutrino::Gateway::Exceptions::SubjectMatterDomainsNotProvided)
          else
            Whitelist.new
          end
        end
def build fail Neutrino :: Gateway :: Exceptions :: BadRequestError if @specified_whitelists . count > 1 whitelist = @specified_whitelists . first values = @whitelist_hash [ whitelist ] case whitelist when :type_of_service_whitelist Whitelist . new . with_template ( '/type_of_service_list/{value}' ) . and_values ( values ) . error_on_empty ( Neutrino :: Gateway :: Exceptions :: TypesOfServiceNotProvided ) when :subject_matter_domain_whitelist Whitelist . new . with_template ( '/subject_matter_domain_list/{value}' ) . and_values ( values ) . error_on_empty ( Neutrino :: Gateway :: Exceptions :: SubjectMatterDomainsNotProvided ) else Whitelist . new end end
Builds a Whitelist, making decisions from values specified in the whitelist Hash
Builds a Whitelist making decisions from values specified in the whitelist Hash
the constructed Whitelist
the constructed Whitelist
Whitelist