lib/avro/builder/dsl.rb in avro-builder-0.12.0 vs lib/avro/builder/dsl.rb in avro-builder-0.13.0

- old
+ new

@@ -87,9 +87,15 @@ # last type defined. def type(*) @last_object = super end + def type_macro(name, type_object, options = {}) + raise "#{type_object.inspect} must be a type object" unless type_object.is_a?(Types::Type) + raise "namespace cannot be included in name: #{name}" if name.to_s.index('.') + cache.add_type_by_name(type_object, name, options[:namespace] || namespace) + end + private def cache @cache ||= Avro::Builder::DefinitionCache.new(self) end