Module: IMW::Schemes::Remote::Base

Defined in:
lib/imw/schemes/remote.rb

Overview

Defines methods appropriate for accessing a remote resource, no matter the protocol.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(obj) ⇒ Object

TODO – self.extended should extend by RemoteDirectory when appropriate



16
17
18
# File 'lib/imw/schemes/remote.rb', line 16

def self.extended obj
  obj.extend(RemoteFile)
end

Instance Method Details

#hostString

The host of this resource.

Returns:



30
31
32
# File 'lib/imw/schemes/remote.rb', line 30

def host
  @host ||= uri.host
end

#is_remote?true, false

Is this resource on a remote host?

Returns:

  • (true, false)


23
24
25
# File 'lib/imw/schemes/remote.rb', line 23

def is_remote?
  true
end

#pathString

Return the path part of this resource’s URI. Will not include the query_string or fragment.

Returns:



46
47
48
# File 'lib/imw/schemes/remote.rb', line 46

def path
  @path ||= uri.path
end

#query_stringString

Return the query string part of this resource’s URI. Will likely be nil for local resources.

Returns:



38
39
40
# File 'lib/imw/schemes/remote.rb', line 38

def query_string
  @query_string ||= uri.query
end