Sha256: d3fa6f3ec3baad7005eb4af904fd7b6228817eec5a07160b412ce4b88e6125d0

Contents?: true

Size: 692 Bytes

Versions: 1

Compression:

Stored size: 692 Bytes

Contents

module Arbetsformedlingen
  QualificationSchema = Dry::Validation.Params do
    configure do
      config.type_specs = true
      config.messages_file = File.expand_path('../../../../config/locales/errors.yml', __FILE__)

      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

  class Qualification < Model
    def initialize(hash)
      super(QualificationSchema.call(hash))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
arbetsformedlingen-0.5.0 lib/arbetsformedlingen/models/qualification.rb