Sha256: 45f6619ff79a1a1145484cde3810591e27a47addf1e3c803d348e6a258764f6d

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

module Arbetsformedlingen
  module Types
    include Dry::Types.module

    StrippedString = Types::Strict::String.constructor { |value| value.to_s.strip }
    UUIDString = Types::Strict::String.constrained(size: 36)
    Currency = Types::Strict::String.constructor do |string|
      string.strip.upcase if string
    end
    # Company Identification Number
    CIN = Types::Strict::String.constructor do |string|
      string.delete(' ').delete('-') if string
    end
    Zip = Types::Strict::String.constructor do |string|
      string.delete(' ') if string
    end
    Municipality = Types::Strict::String.constructor do |string|
      MunicipalityCode.to_code(string)
    end
    Country = Types::Strict::String.constructor do |string|
      CountryCode.to_code(string)
    end
    Occupation = Types::Strict::String.constructor do |string|
      OccupationCode.to_code(string)
    end
    PositionDuration = Types::Strict::Integer
    DriversLicense = Types::Strict::String.constructor do |value|
      DriversLicenseCode.to_code(value)
    end
    SalaryType = Types::Strict::String.constructor do |value|
      SalaryTypeCode.to_code(value)
    end
    ExperienceRequired = Types::Strict::String.constructor do |value|
      ExperienceRequiredCode.to_code(value)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
arbetsformedlingen-0.5.0 lib/arbetsformedlingen/models/dry/types.rb