Class: Echosign::Request::EndpointHash

Inherits:
Object
  • Object
show all
Defined in:
lib/echosign/request.rb

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ EndpointHash

Returns a new instance of EndpointHash.



20
21
22
# File 'lib/echosign/request.rb', line 20

def initialize(paths)
  @paths = paths
end

Instance Method Details

#fetch(endpoint, base_uri) ⇒ String

Get an endpoint by name, using the given base_uri

Parameters:

  • endpoint (Symbol)

    A legal endpoint name, as a symbol

  • base_uri (String)

    A URI that was retrieved from the base_uris API

Returns:

  • (String)

    Returns a URL for the endpoint that begins with the base_uri



29
30
31
# File 'lib/echosign/request.rb', line 29

def fetch(endpoint, base_uri)
  File.join(base_uri, BASE_PATH, @paths.fetch(endpoint))
end