Sha256: b401834b6b593529b236a2fc01605c073b3fb1c45fda37cd80a719cfb0fdf32d

Contents?: true

Size: 570 Bytes

Versions: 10

Compression:

Stored size: 570 Bytes

Contents

module OpenActive
  module Validators
    class BaseModelValidator < BaseValidator
      # Run validation on the given value.
      #
      # @param value [mixed] The value to validate.
      # @return [Boolean] Whether validation passes or not.
      def run(value)
        # With BaseModelValidator we are a bit more relaxed
        # in terms of checking the class name.
        # We allow the class to be an instanceof BaseModel
        # Or to be a sub class (BaseModel is one of its parent)
        value.is_a?(OpenActive::JsonLdModel)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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