lib/service_contract/avro/parameter.rb in service_contract-0.0.7 vs lib/service_contract/avro/parameter.rb in service_contract-0.0.8
- old
+ new
@@ -4,23 +4,16 @@
def name
definition.name
end
def type
- definition.type.type_sym == :record ?
- definition.type.name :
- definition.type.type_sym.to_s
+ Type.build(definition.type)
end
def subtype
- item = definition.type.is_a?(::Avro::Schema::ArraySchema) ?
- definition.type.items :
- nil
- return nil unless item
-
- item.is_a?(::Avro::Schema::PrimitiveSchema) ?
- item.type_sym.to_s :
- item
+ definition.array? ?
+ definition.type.items :
+ nil
end
def default
definition.default
end
\ No newline at end of file