Sha256: 7e848b87e1e8ab91af1f125453e8237e78467065d609fda3bbde68cb1c965773
Contents?: true
Size: 649 Bytes
Versions: 7
Compression:
Stored size: 649 Bytes
Contents
# frozen_string_literal: true module RustyJSONSchema # Handles release of the pointer automatically # with Ruby GC. This way we can intialize validator # in Rust, and hold a reference in Ruby. # class Validator < FFI::AutoPointer # Custom GC flow for our validator, freeing # the object within Rust # def self.release(pointer) Binding.free(pointer) end # Simple validation without actual error messages # def valid?(event) Binding.is_valid(self, RustyJSONSchema.dump(event)) end def validate(event) Binding.validate(self, RustyJSONSchema.dump(event)).to_a end end end
Version data entries
7 entries across 7 versions & 1 rubygems