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
-
.extended(obj) ⇒ Object
TODO – self.extended should extend by RemoteDirectory when appropriate.
Instance Method Summary collapse
-
#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
16 17 18 |
# File 'lib/imw/schemes/remote.rb', line 16 def self.extended obj obj.extend(RemoteFile) end |
Instance Method Details
#host ⇒ String
The host of this resource.
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?
23 24 25 |
# File 'lib/imw/schemes/remote.rb', line 23 def is_remote? true end |
#path ⇒ String
Return the path part of this resource’s URI. Will not include the query_string or fragment.
46 47 48 |
# File 'lib/imw/schemes/remote.rb', line 46 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.
38 39 40 |
# File 'lib/imw/schemes/remote.rb', line 38 def query_string @query_string ||= uri.query end |