Sha256: 7092af760ab0ad10d082ff6c93d0bc5d7d862db7cb3b0f5bbd66fe903fbd83fd

Contents?: true

Size: 576 Bytes

Versions: 2

Compression:

Stored size: 576 Bytes

Contents

# frozen_string_literal: true

module Arbetsformedlingen
  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 ApplicationMethod < Model
    def initialize(hash)
      super(ApplicationMethodSchema.call(hash))
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
arbetsformedlingen-0.7.0 lib/arbetsformedlingen/models/application_method.rb
arbetsformedlingen-0.6.0 lib/arbetsformedlingen/models/application_method.rb