Sha256: 3e089cb13928662fede1a8c00e2121b2324594b79d6edcd821b8434e483cad29

Contents?: true

Size: 428 Bytes

Versions: 2

Compression:

Stored size: 428 Bytes

Contents

require 'rest_client'

module Annal
  module Fetch
    class NetFile
      attr_accessor :path, :file
      def initialize(file_identifier)
        self.file = if file_identifier.respond_to?(:read)
          file_identifier
        else
          self.file = RestClient.get(file_identifier)
        end
      end

      def local?
        false
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

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