Sha256: fda2df43a58903e9bf2cc423d4baee970ac350354b5cb72e63a138563cef0500

Contents?: true

Size: 978 Bytes

Versions: 5

Compression:

Stored size: 978 Bytes

Contents

module RDF; module Util
  ##
  # Wrapper for Kernel.open. Allows implementations to override to get
  # more suffisticated behavior for HTTP resources
  #
  # Classes include this module when they represent some form of a file
  # as a base resource, for instance an HTTP resource representing the
  # serialization of a Graph.
  #
  # This module may be monkey-patched to allow for more options
  # and interfaces.
  #
  # @since 0.2.4
  module File
    # Content
    # @return [String] 
    attr_accessor :content_type
    
    ##
    # Open the file, returning or yielding an IO stream and mime_type.
    #
    # @param [String] filename_or_url to open
    # @param  [Hash{Symbol => Object}] options
    #   any options to pass through to the underlying UUID library
    # @return [IO] File stream
    # @yield [IO] File stream
    def self.open_file(filename_or_url, options = {}, &block)
      Kernel.open(filename_or_url, &block)
    end
  end # File
end; end # RDF::Util

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rdf-0.3.3 lib/rdf/util/file.rb
rdf-0.3.2 lib/rdf/util/file.rb
rdf-0.3.1 lib/rdf/util/file.rb
rdf-0.3.0 lib/rdf/util/file.rb
rdf-0.3.0.pre lib/rdf/util/file.rb