Module: Avro::LogicalTypes
- Defined in:
- lib/avro/logical_types.rb
Defined Under Namespace
Modules: Identity, IntDate, TimestampMicros, TimestampMillis Classes: BytesDecimal, LogicalTypeWithSchema
Constant Summary collapse
- TYPES =
{ "bytes" => { "decimal" => BytesDecimal }, "int" => { "date" => IntDate }, "long" => { "timestamp-millis" => TimestampMillis, "timestamp-micros" => TimestampMicros }, }.freeze
Class Method Summary collapse
Class Method Details
.type_adapter(type, logical_type, schema = nil) ⇒ Object
267 268 269 270 271 272 |
# File 'lib/avro/logical_types.rb', line 267 def self.type_adapter(type, logical_type, schema = nil) return unless logical_type adapter = TYPES.fetch(type, {}.freeze).fetch(logical_type, Identity) adapter.is_a?(Class) ? adapter.new(schema) : adapter end |