Sha256: 16d639d10b65df5f23bf01e62733399f7108cf2b67a12cf9910592c303d34486

Contents?: true

Size: 431 Bytes

Versions: 10

Compression:

Stored size: 431 Bytes

Contents

module OpenActive
  module Validators
    class InstanceValidator < BaseValidator
      attr_accessor :classname

      def initialize(classname)
        @classname = classname
      end

      # Run validation on the given value.
      #
      # @param value [mixed] The value to validate.
      # @return [Boolean] Whether validation passes or not.
      def run(value)
        value.is_a?(classname)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
openactive-0.5.0 lib/openactive/validators/instance_validator.rb
openactive-0.4.0 lib/openactive/validators/instance_validator.rb
openactive-0.3.0 lib/openactive/validators/instance_validator.rb
openactive-0.2.2 lib/openactive/validators/instance_validator.rb
openactive-0.2.1 lib/openactive/validators/instance_validator.rb
openactive-0.2.0 lib/openactive/validators/instance_validator.rb
openactive-0.1.2 lib/openactive/validators/instance_validator.rb
openactive-0.1.1 lib/openactive/validators/instance_validator.rb
openactive-0.1.0 lib/openactive/validators/instance_validator.rb
openactive-0.1.0.rc1 lib/openactive/validators/instance_validator.rb