Sha256: ae9ec940548212e7520d80715c10e6f3b0d33b7e1135c5815e091d7f2d634e47

Contents?: true

Size: 265 Bytes

Versions: 3

Compression:

Stored size: 265 Bytes

Contents

Avro::Schema.class_eval do
  # Determine if a ruby datum is an instance of a schema
  def self.validate(expected_schema, datum)
    Avro::SchemaValidator.validate!(expected_schema, datum)
    true
  rescue Avro::SchemaValidator::ValidationError
    false
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
avro-patches-0.2.0 lib/avro-patches/schema_validator/schema.rb
avro-patches-0.1.0 lib/avro-patches/schema_validator/schema.rb
avro-patches-0.1.0.rc0 lib/avro-patches/schema_validator/schema.rb