Sha256: 5721671ed53201b49dc58ecb196b85dd2fdce1125ce5f844a7e8db3dc3367ddc

Contents?: true

Size: 389 Bytes

Versions: 20

Compression:

Stored size: 389 Bytes

Contents

module Shogun
  module Verifier
    class Presence
      def initialize(name:, data:)
        @data = data
        @name = name
      end

      def valid?
        if @data.is_a?(String)
          @data.split("").any?
        else
          !@data.nil?
        end
      end

      def id
        "#{@name}_not_present"
      end

      def context
        nil
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
shogun-6.4.2 lib/shogun/verifier/presence.rb
shogun-6.4.1 lib/shogun/verifier/presence.rb
shogun-6.4.0 lib/shogun/verifier/presence.rb
shogun-6.3.0 lib/shogun/verifier/presence.rb
shogun-6.2.3 lib/shogun/verifier/presence.rb
shogun-6.2.2 lib/shogun/verifier/presence.rb
shogun-6.2.1 lib/shogun/verifier/presence.rb
shogun-6.2.0 lib/shogun/verifier/presence.rb
shogun-6.1.0 lib/shogun/verifier/presence.rb
shogun-6.0.0 lib/shogun/verifier/presence.rb
shogun-4.0.1 lib/shogun/verifier/presence.rb
shogun-4.0.0 lib/shogun/verifier/presence.rb
shogun-3.4.0 lib/shogun/verifier/presence.rb
shogun-3.2.0 lib/shogun/verifier/presence.rb
shogun-3.1.0 lib/shogun/verifier/presence.rb
shogun-3.0.0 lib/shogun/verifier/presence.rb
shogun-2.1.1 lib/shogun/verifier/presence.rb
shogun-2.1.0 lib/shogun/verifier/presence.rb
shogun-2.0.0 lib/shogun/verifier/presence.rb
shogun-1.0.0 lib/shogun/verifier/presence.rb