Sha256: e3621be1429510b4c096a81d191258454b59ee39c4f5c6bf678a4c3c74937367

Contents?: true

Size: 602 Bytes

Versions: 6

Compression:

Stored size: 602 Bytes

Contents

module {{namespace_module}}
  module {{resource_module}}
    module Destroy
      class Validator
        include Shogun::Validator
        include {{resource_module}}

        ID_MATCH = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/

        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::Presence.new(data: data.session, name: "session")
          ]
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shogun-6.4.2 scaffold/generate/resource/destroy/validator.rb
shogun-6.4.1 scaffold/generate/resource/destroy/validator.rb
shogun-6.4.0 scaffold/generate/resource/destroy/validator.rb
shogun-6.3.0 scaffold/generate/resource/destroy/validator.rb
shogun-6.2.3 scaffold/generate/resource/destroy/validator.rb
shogun-6.2.2 scaffold/generate/resource/destroy/validator.rb