Sha256: b5cfe167891c4eeac4579a49b9cbd92c2b125fdcb08b3f60f48cd57c389a5490

Contents?: true

Size: 563 Bytes

Versions: 3

Compression:

Stored size: 563 Bytes

Contents

module Discoverer
  
  # Discoverer Method implementation for Readers
  # Implements method #from
  module Reader

    # Discoverer method
    # @return [Reader] the reader object for this object, initialized
    def from
      begin
        @_reader ||= Discoverer.for( ::Reader, self.class ).new self
        @_reader
      rescue Discoverer::NotFoundError => e 
        raise MissingReaderError, "The reader for #{self.class} (Reader::#{self.class}) wasn't found, please create it"
      end
    end

    class MissingReaderError < StandardError; end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discoverer-0.0.3 lib/discoverer/reader.rb
discoverer-0.0.2 lib/discoverer/reader.rb
discoverer-0.0.1 lib/discoverer/reader.rb