Class: Avro2Kafka::AvroReader

Inherits:
Object
  • Object
show all
Defined in:
lib/avro2kafka/avro_reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ AvroReader

Returns a new instance of AvroReader.



7
8
9
10
# File 'lib/avro2kafka/avro_reader.rb', line 7

def initialize(io)
  @io = io
  @reader = Avro::IO::DatumReader.new()
end

Instance Attribute Details

#ioObject (readonly)

Returns the value of attribute io.



5
6
7
# File 'lib/avro2kafka/avro_reader.rb', line 5

def io
  @io
end

Instance Method Details

#readObject



12
13
14
# File 'lib/avro2kafka/avro_reader.rb', line 12

def read
  Avro::DataFile::Reader.new(io, @reader).to_enum
end