Module: IMW::Resources::RemoteObj
- Defined in:
- lib/imw/resources/remote.rb
Overview
Defines methods appropriate for accessing a remote resource, no matter what the protocol.
Class Method Summary collapse
-
.extended(obj) ⇒ Object
TODO – self.extended should extend by RemoteDirectory when appropriate.
Instance Method Summary collapse
-
#fragment ⇒ String
Return the fragment part of this resource’s URI.
-
#host ⇒ String
The host of this resource.
-
#is_remote? ⇒ true, false
Is this resource on a remote host?.
-
#path ⇒ String
Return the path part of this resource’s URI.
-
#query_string ⇒ String
Return the query string part of this resource’s URI.
Class Method Details
.extended(obj) ⇒ Object
TODO – self.extended should extend by RemoteDirectory when appropriate
12 13 14 |
# File 'lib/imw/resources/remote.rb', line 12 def self.extended obj obj.extend(RemoteFile) end |
Instance Method Details
#fragment ⇒ String
Return the fragment part of this resource’s URI. Will likely be nil
for local resources.
42 43 44 |
# File 'lib/imw/resources/remote.rb', line 42 def fragment @fragment ||= uri.fragment end |
#host ⇒ String
The host of this resource.
26 27 28 |
# File 'lib/imw/resources/remote.rb', line 26 def host @host ||= uri.host end |
#is_remote? ⇒ true, false
Is this resource on a remote host?
19 20 21 |
# File 'lib/imw/resources/remote.rb', line 19 def is_remote? true end |
#path ⇒ String
Return the path part of this resource’s URI. Will not include the query_string
or fragment
.
50 51 52 |
# File 'lib/imw/resources/remote.rb', line 50 def path @path ||= uri.path end |
#query_string ⇒ String
Return the query string part of this resource’s URI. Will likely be nil
for local resources.
34 35 36 |
# File 'lib/imw/resources/remote.rb', line 34 def query_string @query_string ||= uri.query end |