Sha256: d593c49ae39571738f38bf35a8fbbf9a47529e923a2af2f106294aab961cb740

Contents?: true

Size: 702 Bytes

Versions: 6

Compression:

Stored size: 702 Bytes

Contents

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

        ID_MATCH = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
        FIELDS_ALLOWED = %w|updated_at destroyed_at href created_at bio name email username signature id|

        def initialize(data:)
          @verifiers = [
            Shogun::Verifier::Presence.new(data: data.id, name: "id"),
            Shogun::Verifier::Match.new(data: data.id, name: "id", comparison: ID_MATCH),
            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/show/validator.rb
shogun-6.4.1 scaffold/new/project/lib/namespace/accounts/show/validator.rb
shogun-6.4.0 scaffold/new/project/lib/namespace/accounts/show/validator.rb
shogun-6.3.0 scaffold/new/project/lib/namespace/accounts/show/validator.rb
shogun-6.2.3 scaffold/new/project/lib/namespace/accounts/show/validator.rb
shogun-6.2.2 scaffold/new/project/lib/namespace/accounts/show/validator.rb