Module: BerkeleyLibrary::Util::URIs
- Extended by:
- URIs
- Included in:
- TIND::Config, URIs
- Defined in:
- lib/berkeley_library/util/uris.rb,
lib/berkeley_library/util/uris/appender.rb,
lib/berkeley_library/util/uris/requester.rb,
lib/berkeley_library/util/uris/validator.rb
Defined Under Namespace
Modules: Requester, Validator Classes: Appender
Instance Method Summary collapse
-
#append(uri, *elements) ⇒ URI
Appends the specified paths to the path of the specified URI, removing any extraneous slashes and merging additional query parameters, and returns a new URI with that path and the same scheme, host, query, fragment, etc.
-
#get(uri, params = {}, headers = {}) ⇒ String
Performs a GET request.
-
#uri_or_nil(url) ⇒ URI
Returns the specified URL as a URI.
Instance Method Details
#append(uri, *elements) ⇒ URI
Appends the specified paths to the path of the specified URI, removing any extraneous slashes and merging additional query parameters, and returns a new URI with that path and the same scheme, host, query, fragment, etc. as the original.
20 21 22 |
# File 'lib/berkeley_library/util/uris.rb', line 20 def append(uri, *elements) Appender.new(uri, *elements).to_uri end |
#get(uri, params = {}, headers = {}) ⇒ String
Performs a GET request.
31 32 33 |
# File 'lib/berkeley_library/util/uris.rb', line 31 def get(uri, params = {}, headers = {}) Requester.get(uri, params, headers) end |
#uri_or_nil(url) ⇒ URI
Returns the specified URL as a URI.
39 40 41 |
# File 'lib/berkeley_library/util/uris.rb', line 39 def uri_or_nil(url) Validator.uri_or_nil(url) end |