Class: Mexico::FileSystem::URL

Inherits:
Object
  • Object
show all
Extended by:
IdRef, StaticCollectionRef
Includes:
BoundToCorpus, Poseidon, ROXML
Defined in:
lib/mexico/file_system/url.rb

Overview

An URL object stands for a resource representation at the given location.

Instance Attribute Summary

Attributes included from BoundToCorpus

#corpus

Instance Method Summary collapse

Methods included from IdRef

id_ref

Methods included from StaticCollectionRef

collection_ref

Methods included from BoundToCorpus

#bind_to_corpus

Constructor Details

#initialize(opts = {}) ⇒ URL

Returns a new instance of URL.



45
46
47
48
49
50
# File 'lib/mexico/file_system/url.rb', line 45

def initialize(opts={})
  # @corpus = corpus
  [:identifier,:name,:description].each do |att|
    send("#{att}=", opts[att]) if opts.has_key?(att)
  end
end

Instance Method Details

#get(opts = {}) ⇒ String or ByteArray

Attempts to fetch the contents at this resource.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :format (String)

    The format to be retrieved. If omitted, the standard format will be retrieved.

Returns:

  • (String or ByteArray)

    The file contents, as a string or binary object.



61
62
63
# File 'lib/mexico/file_system/url.rb', line 61

def get(opts = {} )
  # @todo Implement this method stub
end

#infoHash

Retrieves a bunch of meta data with information about this resource representation.

Returns:

  • (Hash)

    A hash containing various information (size, mime_type, availability)



54
55
56
# File 'lib/mexico/file_system/url.rb', line 54

def info
  # @todo Implement this method stub
end