Module: Arbetsformedlingen

Defined in:
lib/arbetsformedlingen.rb,
lib/arbetsformedlingen/version.rb,
lib/arbetsformedlingen/api/client.rb,
lib/arbetsformedlingen/key_struct.rb,
lib/arbetsformedlingen/api/request.rb,
lib/arbetsformedlingen/api/response.rb,
lib/arbetsformedlingen/models/model.rb,
lib/arbetsformedlingen/soap_builder.rb,
lib/arbetsformedlingen/models/packet.rb,
lib/arbetsformedlingen/models/salary.rb,
lib/arbetsformedlingen/models/company.rb,
lib/arbetsformedlingen/models/document.rb,
lib/arbetsformedlingen/models/position.rb,
lib/arbetsformedlingen/models/schedule.rb,
lib/arbetsformedlingen/api/soap_request.rb,
lib/arbetsformedlingen/models/dry/types.rb,
lib/arbetsformedlingen/codes/country_code.rb,
lib/arbetsformedlingen/models/publication.rb,
lib/arbetsformedlingen/api/ontology_client.rb,
lib/arbetsformedlingen/api/taxonomy_client.rb,
lib/arbetsformedlingen/api/base_soap_client.rb,
lib/arbetsformedlingen/api/matchning_client.rb,
lib/arbetsformedlingen/models/qualification.rb,
lib/arbetsformedlingen/api/results/ad_result.rb,
lib/arbetsformedlingen/codes/occupation_code.rb,
lib/arbetsformedlingen/models/dry/predicates.rb,
lib/arbetsformedlingen/codes/salary_type_code.rb,
lib/arbetsformedlingen/api/ledigtarbete_client.rb,
lib/arbetsformedlingen/codes/municipality_code.rb,
lib/arbetsformedlingen/api/ws_occupation_client.rb,
lib/arbetsformedlingen/api/values/create_ad_page.rb,
lib/arbetsformedlingen/models/application_method.rb,
lib/arbetsformedlingen/models/packet_xml_builder.rb,
lib/arbetsformedlingen/api/values/soklista_values.rb,
lib/arbetsformedlingen/codes/drivers_license_code.rb,
lib/arbetsformedlingen/api/results/soklista_result.rb,
lib/arbetsformedlingen/api/values/ad_result_values.rb,
lib/arbetsformedlingen/api/results/matchning_result.rb,
lib/arbetsformedlingen/codes/experience_required_code.rb,
lib/arbetsformedlingen/api/values/matchning_result_values.rb

Defined Under Namespace

Modules: API, DriversLicenseCode, Predicates, Types Classes: ApplicationMethod, Company, Configuration, CountryCode, Document, ExperienceRequiredCode, KeyStruct, Model, MunicipalityCode, OccupationCode, Packet, PacketXMLBuilder, Position, Publication, Qualification, SOAPBuilder, Salary, SalaryTypeCode, Schedule

Constant Summary collapse

VERSION =

Gem version

'0.7.0'.freeze
PacketSchema =
Dry::Validation.Params do
  configure do
    config.type_specs = true
    config.messages_file = File.expand_path('../../../config/locales/errors.yml', __dir__)

    predicates(Predicates)
  end

  required(:active, Types::Bool).filled
  required(:job_id, Types::StrippedString).filled
  required(:id, Types::StrippedString).filled
  required(:number_to_fill, Types::Integer).filled(gt?: 0)
  required(:occupation, Types::Occupation).filled(:occupation_code?)
end
SalarySchema =
Dry::Validation.Params do
  configure do
    config.type_specs = true
    config.messages_file = File.expand_path('../../../config/locales/errors.yml', __dir__)

    predicates(Predicates)
  end

  required(:summary, Types::StrippedString).filled
  required(:currency, Types::Currency).filled(:str?, :currency?)
  required(:type, Types::SalaryType).filled(:str?, :salary_type?)
end
CompanySchema =
Dry::Validation.Params do
  configure do
    config.type_specs = true
    config.messages_file = File.expand_path('../../../config/locales/errors.yml', __dir__)

    predicates(Predicates)
  end

  required(:name, Types::StrippedString).filled
  required(:cin, Types::CIN).filled(:str?, :cin?)

  optional(:description, Types::StrippedString).filled

  required(:address).schema do
    required(:municipality, Types::Municipality).filled(:municipality?)
    required(:country_code, Types::Country).filled(:str?, :country_code?)
    required(:street, Types::StrippedString).filled
    required(:city, Types::StrippedString).filled
    required(:zip, Types::Zip).filled(:str?, :zip?)
  end
end
DocumentSchema =
Dry::Validation.Params do
  configure do
    config.type_specs = true
    config.messages_file = File.expand_path('../../../config/locales/errors.yml', __dir__)

    predicates(Predicates)
  end

  required(:id, Types::UUIDString).filled
  required(:timestamp, :string).filled(:iso8601_date?)
  required(:customer_id, Types::StrippedString).filled
  required(:email, Types::StrippedString).filled(:str?, :email?)
end
PositionSchema =
Dry::Validation.Params do
  configure do
    config.type_specs = true
    config.messages_file = File.expand_path('../../../config/locales/errors.yml', __dir__) # rubocop:disable Metrics/LineLength

    predicates(Predicates)
  end

  required(:title, Types::StrippedString).filled
  required(:purpose, Types::StrippedString).filled
  required(:address).schema do
    required(:municipality, Types::Municipality).filled(:municipality?)
    required(:country_code, Types::Country).filled(:str?, :country_code?)

    optional(:street, Types::StrippedString).filled
    optional(:city, Types::StrippedString).filled
    optional(:zip, Types::Zip).filled(:str?, :zip?)
  end
end
ScheduleSchema =
Dry::Validation.Params do
  configure do
    config.type_specs = true
    config.messages_file = File.expand_path('../../../config/locales/errors.yml', __dir__)

    predicates(Predicates)
  end

  required(:summary, Types::StrippedString).filled
  required(:full_time, Types::Strict::Bool).filled
  required(:position_duration_code, Types::PositionDuration).filled
  required(:start_date, Types::StrippedString).filled(:yyyy_mm_dd?)

  optional(:end_date, Types::StrippedString)
end
PublicationSchema =
Dry::Validation.Params do
  configure do
    config.type_specs = true
    config.messages_file = File.expand_path('../../../config/locales/errors.yml', __dir__)

    predicates(Predicates)
  end

  required(:unpublish_at, :string).filled(:yyyy_mm_dd?)
  required(:name, Types::StrippedString).filled
  required(:email, Types::StrippedString).filled(:str?, :email?)

  optional(:publish_at, :string).filled(:yyyy_mm_dd?)
end
QualificationSchema =
Dry::Validation.Params do
  configure do
    config.type_specs = true
    config.messages_file = File.expand_path('../../../config/locales/errors.yml', __dir__)

    predicates(Predicates)
  end

  required(:required, Types::Bool).filled

  optional(:drivers_license, Types::DriversLicense).filled(:drivers_license?)
  optional(:car, Types::Bool).filled(:bool?)
  optional(:summary, Types::StrippedString).filled
  optional(:experience, Types::ExperienceRequired).filled(:experience_required?)
end
ApplicationMethodSchema =
Dry::Validation.Params do
  configure do
    config.type_specs = true
    config.messages_file = File.expand_path('../../../config/locales/errors.yml', __dir__)

    predicates(Predicates)
  end

  required(:external, Types::Bool).filled
  required(:summary, Types::StrippedString).filled
  required(:url, Types::StrippedString).filled(:url?)
end

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config


41
42
43
# File 'lib/arbetsformedlingen.rb', line 41

def config
  @config
end

Class Method Details

.configureObject


44
45
46
47
# File 'lib/arbetsformedlingen.rb', line 44

def self.configure
  self.config ||= Configuration.new
  block_given? ? yield(config) : config
end