Class: Avro2Kafka::AvroReader
- Inherits:
-
Object
- Object
- Avro2Kafka::AvroReader
- Defined in:
- lib/avro2kafka/avro_reader.rb
Instance Attribute Summary collapse
-
#io ⇒ Object
readonly
Returns the value of attribute io.
Instance Method Summary collapse
-
#initialize(io) ⇒ AvroReader
constructor
A new instance of AvroReader.
- #read ⇒ Object
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
#io ⇒ Object (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
#read ⇒ Object
12 13 14 |
# File 'lib/avro2kafka/avro_reader.rb', line 12 def read Avro::DataFile::Reader.new(io, @reader).to_enum end |