Module: DbAgile::Restful::Client::Utils

Included in:
DbAgile::Restful::Client
Defined in:
lib/dbagile/restful/client/utils.rb

Instance Method Summary collapse

Instance Method Details

#with_uri(path, projection = nil) {|URI.parse(uri)| ... } ⇒ Object

Yields the block with an URI to access the server

Yields:

  • (URI.parse(uri))


7
8
9
10
11
# File 'lib/dbagile/restful/client/utils.rb', line 7

def with_uri(path, projection = nil)
  uri = "#{server_uri}#{path}"
  uri += ("?" + tuple_to_querystring(projection)) if projection
  yield(URI.parse(uri))
end