Class: BioInterchange::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/biointerchange/reader.rb

Overview

A reader takes information from an input stream and creates an object model.

For example, the input stream might hold text-mining data in some format. This data is deserialized by the reader and turned into an object model representation, i.e. an instance of a Ruby class that describes the data.

Instance Method Summary collapse

Constructor Details

#initializeReader

Create a new instance of a reader. Ideally you want to provide your own initialization method in derived classes that takes some extra parameters for configuring/parametrizing the data deserialization with deserialize.



13
14
# File 'lib/biointerchange/reader.rb', line 13

def initialize
end

Instance Method Details

#deserialize(istream) ⇒ Object

Reads data from the provided input stream and returns an input specific object model instance.

istream

input IO stream to deserialize



19
20
21
# File 'lib/biointerchange/reader.rb', line 19

def deserialize(istream)
  raise BioInterchange::Exceptions::ImplementationReaderError, 'You must implement this method, which reads data from an input stream and returns an object model instance.'
end