Sha256: beaa63248becf72cbc2147c61477ad930e1a1cbcca32a146c248696c0d399970

Contents?: true

Size: 433 Bytes

Versions: 3

Compression:

Stored size: 433 Bytes

Contents

module Discoverer
  module Writer

    def to
      begin
        @_writer ||= Discoverer.for(::Writer, self.class).new self
        @_writer
      rescue Discoverer::NotFoundError => e 
        raise MissingWriterError, "The writer for #{self.class} (Writer::#{self.class}) wasn't found, please create it"
      end
    end

    class MissingWriterError < StandardError; end
    class EmptySourceError < StandardError; end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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