class Api2cart::RequestUrlComposer

Public Instance Methods

compose_request_url() click to toggle source
# File lib/api2cart/request_url_composer.rb, line 12
def compose_request_url
  URI::HTTP.build host: host, path: full_path, query: query_string
end

Protected Instance Methods

dotted_method_name() click to toggle source
# File lib/api2cart/request_url_composer.rb, line 22
def dotted_method_name
  method_name.to_s.gsub('__', '-').gsub('_', '.').gsub('-', '_')
end
full_path() click to toggle source
# File lib/api2cart/request_url_composer.rb, line 18
def full_path
  "/v#{api_version}/#{dotted_method_name}.json"
end
query_string() click to toggle source
# File lib/api2cart/request_url_composer.rb, line 26
def query_string
  { api_key: api_key, store_key: store_key }.merge(query_params || {}).to_param
end