Sha256: ce95a75e5b977b6031208fee72da76350713dfeb9bd829647447a3155bd6814e

Contents?: true

Size: 502 Bytes

Versions: 2

Compression:

Stored size: 502 Bytes

Contents

# This is free and unencumbered software released into the public domain.

require 'rdf/format'

module RDF::Borsh
  class Format < RDF::Format
    content_type 'application/x-rdf+borsh', extension: :rdfb
    reader { RDF::Borsh::Reader }
    writer { RDF::Borsh::Writer }

    MAGIC = 'RDFB'.freeze
    VERSION = '1'.ord
    FLAGS = 0b00000111

    def self.name; "RDF/Borsh"; end

    def self.detect(sample)
      sample[0..4] == [MAGIC, VERSION].pack('a4C')
    end
  end # Format
end # RDF::Borsh

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rdf-borsh-1.0.2 lib/rdf/borsh/format.rb
rdf-borsh-1.0.1 lib/rdf/borsh/format.rb