Method: APIClientBuilder::URLGenerator#initialize

Defined in:
lib/api_client_builder/url_generator.rb

#initialize(domain) ⇒ URLGenerator

Receives a domain and parses it into a URI

Parameters:

  • the domain of the API



7
8
9
10
11
# File 'lib/api_client_builder/url_generator.rb', line 7

def initialize(domain)
  @base_uri = URI.parse(domain)
  @base_uri = URI.parse('https://' + domain) if @base_uri.scheme.nil?
  @base_uri.path << '/' unless @base_uri.path.end_with?('/')
end