Sha256: ad336f381c17251852130482ee53d08e6edee5c3f9cceae0395b399e41aef388

Contents?: true

Size: 905 Bytes

Versions: 6

Compression:

Stored size: 905 Bytes

Contents

module {{namespace_module}}
  module Accounts
    module List
      class Validator
        include Shogun::Validator
        include Accounts

        INCLUDES_ALLOWED = %w||
        FIELDS_ALLOWED = %w|updated_at destroyed_at href created_at name email username signature id meta links linked|
        FILTERS_ALLOWED = %w|username signature created_at name|
        LIMIT_RANGE = 1..100

        def initialize(data:)
          @verifiers = [
            Shogun::Verifier::Range.new(data: data.limit, name: "limit", range: LIMIT_RANGE),
            Shogun::Verifier::Allowed.new(data: data.filters.keys, name: "filters", list: FILTERS_ALLOWED),
            Shogun::Verifier::Allowed.new(data: data.includes, name: "includes", list: INCLUDES_ALLOWED),
            Shogun::Verifier::Allowed.new(data: data.fields, name: "fields", list: FIELDS_ALLOWED)
          ]
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shogun-6.4.2 scaffold/new/project/lib/namespace/accounts/list/validator.rb
shogun-6.4.1 scaffold/new/project/lib/namespace/accounts/list/validator.rb
shogun-6.4.0 scaffold/new/project/lib/namespace/accounts/list/validator.rb
shogun-6.3.0 scaffold/new/project/lib/namespace/accounts/list/validator.rb
shogun-6.2.3 scaffold/new/project/lib/namespace/accounts/list/validator.rb
shogun-6.2.2 scaffold/new/project/lib/namespace/accounts/list/validator.rb