Sha256: 469f6ff6e083599a4e4becb76b8be2a5e688a86cb166c6abb004830242288e78

Contents?: true

Size: 737 Bytes

Versions: 6

Compression:

Stored size: 737 Bytes

Contents

require 'avro/builder/version'
require 'avro/builder/dsl'
require 'avro/builder/schema_store'

module Avro
  module Builder

    # Accepts a string or block to eval to define a JSON schema
    def self.build(str = nil, filename: nil, &block)
      Avro::Builder::DSL.new(str, filename: filename, &block).to_json
    end

    # Accepts a string or block to eval and returns an Avro::Schema
    def self.build_schema(str = nil, filename: nil, &block)
      Avro::Builder::DSL.new(str, filename: filename, &block).as_schema
    end

    # Add paths that will be searched for definitions
    def self.add_load_path(*paths)
      Avro::Builder::DSL.load_paths.merge(paths)
    end
  end
end

require 'avro/builder/railtie' if defined?(Rails)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
avro-builder-0.14.1 lib/avro/builder.rb
avro-builder-0.14.0 lib/avro/builder.rb
avro-builder-0.13.0 lib/avro/builder.rb
avro-builder-0.12.0 lib/avro/builder.rb
avro-builder-0.11.0 lib/avro/builder.rb
avro-builder-0.10.0 lib/avro/builder.rb