Module: Avro::Builder
- Defined in:
- lib/avro/builder.rb,
lib/avro/builder/dsl.rb,
lib/avro/builder/enum.rb,
lib/avro/builder/field.rb,
lib/avro/builder/fixed.rb,
lib/avro/builder/errors.rb,
lib/avro/builder/record.rb,
lib/avro/builder/railtie.rb,
lib/avro/builder/version.rb,
lib/avro/builder/aliasable.rb,
lib/avro/builder/types/type.rb,
lib/avro/builder/dsl_options.rb,
lib/avro/builder/file_handler.rb,
lib/avro/builder/schema_store.rb,
lib/avro/builder/type_factory.rb,
lib/avro/builder/namespaceable.rb,
lib/avro/builder/dsl_attributes.rb,
lib/avro/builder/types/map_type.rb,
lib/avro/builder/anonymous_types.rb,
lib/avro/builder/types/enum_type.rb,
lib/avro/builder/types/top_level.rb,
lib/avro/builder/definition_cache.rb,
lib/avro/builder/types/array_type.rb,
lib/avro/builder/types/bytes_type.rb,
lib/avro/builder/types/fixed_type.rb,
lib/avro/builder/types/named_type.rb,
lib/avro/builder/types/union_type.rb,
lib/avro/builder/types/record_type.rb,
lib/avro/builder/types/complex_type.rb,
lib/avro/builder/types/type_referencer.rb,
lib/avro/builder/rake/avro_generate_task.rb,
lib/avro/builder/types/named_error_handling.rb,
lib/avro/builder/schema_serializer_reference_state.rb
Defined Under Namespace
Modules: Aliasable, AnonymousTypes, DslAttributes, DslOptions, FileHandler, Namespaceable, Rake, TypeFactory, Types Classes: DSL, DefinitionCache, DefinitionNotFoundError, DuplicateDefinitionError, Enum, Field, Fixed, Railtie, Record, RequiredAttributeError, SchemaError, SchemaSerializerReferenceState, SchemaStore
Constant Summary collapse
- AttributeError =
Class.new(StandardError)
- VERSION =
'2.1.0'
Class Method Summary collapse
-
.add_load_path(*paths) ⇒ Object
Add paths that will be searched for definitions.
-
.build(str = nil, filename: nil, &block) ⇒ Object
Accepts a string or block to eval to define a JSON schema.
-
.build_dsl(str = nil, filename: nil, &block) ⇒ Object
Accepts a string or block to eval and returns the Avro::Builder::DSL object.
-
.build_schema(str = nil, filename: nil, &block) ⇒ Object
Accepts a string or block to eval and returns an Avro::Schema object.
Class Method Details
.add_load_path(*paths) ⇒ Object
Add paths that will be searched for definitions
26 27 28 |
# File 'lib/avro/builder.rb', line 26 def self.add_load_path(*paths) Avro::Builder::DSL.load_paths.merge(paths) end |
.build(str = nil, filename: nil, &block) ⇒ Object
Accepts a string or block to eval to define a JSON schema
16 17 18 |
# File 'lib/avro/builder.rb', line 16 def self.build(str = nil, filename: nil, &block) Avro::Builder::DSL.new(str, filename: filename, &block).to_json end |
.build_dsl(str = nil, filename: nil, &block) ⇒ Object
Accepts a string or block to eval and returns the Avro::Builder::DSL object
11 12 13 |
# File 'lib/avro/builder.rb', line 11 def self.build_dsl(str = nil, filename: nil, &block) Avro::Builder::DSL.new(str, filename: filename, &block) end |
.build_schema(str = nil, filename: nil, &block) ⇒ Object
Accepts a string or block to eval and returns an Avro::Schema object
21 22 23 |
# File 'lib/avro/builder.rb', line 21 def self.build_schema(str = nil, filename: nil, &block) Avro::Builder::DSL.new(str, filename: filename, &block).as_schema end |