Sha256: 90a71570d225d9cb40a033260ec1037c944e3fa3f2231a1cdf50339136627fb3

Contents?: true

Size: 760 Bytes

Versions: 4

Compression:

Stored size: 760 Bytes

Contents

# frozen_string_literal: true

require "dry-validation"
require "roseflow/proxycurl/object"
require "roseflow/linkedin/job"
require "roseflow/types"

module Roseflow
  module LinkedIn
    class Job
      class ProfileQuery < Proxycurl::ProxycurlObject
        class ProfileQueryContract < Dry::Validation::Contract
          params do
            required(:url).filled(:string)
          end
        end

        contract_object ProfileQueryContract

        schema schema.strict

        attribute :url, Types::String

        def self.new(input)
          validation = self.contract_object.new.call(input)
          raise ArgumentError, validation.errors.to_h.inspect unless validation.success?
          super(input)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
roseflow-proxycurl-0.5.5 lib/roseflow/linkedin/job/profile_query.rb
roseflow-proxycurl-0.5.2 lib/roseflow/linkedin/job/profile_query.rb
roseflow-proxycurl-0.5.1 lib/roseflow/linkedin/job/profile_query.rb
roseflow-proxycurl-0.5.0 lib/roseflow/linkedin/job/profile_query.rb