Class: DR::URIWrapper

Inherits:
SimpleDelegator
  • Object
show all
Includes:
URIlikeWrapper
Defined in:
lib/dr/base/uri.rb

Direct Known Subclasses

Ssh

Defined Under Namespace

Classes: Ssh

Class Method Summary collapse

Instance Method Summary collapse

Methods included from URIlikeWrapper

#reverse_merge, #soft_merge, #to_h, #to_json, #to_public

Constructor Details

#initialize(uri) ⇒ URIWrapper

recall that '//user@server' is an uri while 'user@server' is just a path



189
190
191
192
# File 'lib/dr/base/uri.rb', line 189

def initialize(uri)
	super
	self.uri = uri
end

Class Method Details

.get_uri_object(uri) ⇒ Object



158
159
160
161
# File 'lib/dr/base/uri.rb', line 158

def self.get_uri_object(uri)
	uri = self.parse(uri.to_s) unless uri.is_a?(URI)
	uri
end

.parse(s) ⇒ Object



154
155
156
# File 'lib/dr/base/uri.rb', line 154

def self.parse(s)
	new(URI.parse(s))
end

Instance Method Details

#uriObject



144
145
146
# File 'lib/dr/base/uri.rb', line 144

def uri
	 __getobj__
end

#uri=(uri) ⇒ Object



148
149
150
# File 'lib/dr/base/uri.rb', line 148

def uri=(uri)
	__setobj__(transform_uri(uri))
end