Sha256: ddec6e5c7689e9fd1c6c2218b4ce95894e12454cd83c2e64b5c7418134df48d8
Contents?: true
Size: 999 Bytes
Versions: 9
Compression:
Stored size: 999 Bytes
Contents
module Avro module Builder # This concern is included by contexts where anonymous types can be defined. module AnonymousTypes include Avro::Builder::TypeFactory Avro::Schema::PRIMITIVE_TYPES_SYM.each do |type_name| define_method(type_name) do |options = {}, &block| type(type_name, options, &block) end end def union(*types, &block) type(__method__, { types: types }, &block) end def array(items, options = {}, &block) type(__method__, { items: items }.merge(options), &block) end def map(values, options = {}, &block) type(__method__, { values: values }.merge(options), &block) end def type(type_name, options = {}, &block) create_and_configure_builtin_type(type_name, cache: cache, internal: options, &block) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems