Sha256: f6734c3d5d5d8ef8030ffb198a8d78ef408b0e9d15213196b5d432189b82e6ba

Contents?: true

Size: 387 Bytes

Versions: 2

Compression:

Stored size: 387 Bytes

Contents

module Annal
  module Fetch
    class LocalFile
      attr_accessor :path, :file
      def initialize(file_identifier)
        self.file = if file_identifier.respond_to?(:read)
          file_identifier
        else
          File.open(file_identifier)
        end
      end

      def local?
        true
      end

      def read
        @read ||= file.read
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
annal-0.0.4 lib/annal/fetch/local_file.rb
annal-0.0.3 lib/annal/fetch/local_file.rb