class Wego::Client

Attributes

attributes[R]
end_point[R]

Public Class Methods

new(end_point, attributes = {}) click to toggle source
# File lib/wego/client.rb, line 9
def initialize(end_point, attributes = {})
  @end_point = end_point
  @attributes = attributes
end

Public Instance Methods

get() click to toggle source
# File lib/wego/client.rb, line 14
def get
  RestClient.get api_path, params: api_params
end
url() click to toggle source
# File lib/wego/client.rb, line 18
def url
  params = api_params.map { |key, value| "#{key}=#{value}" }.join("&")
  [api_path, params].join("?")
end

Private Instance Methods

api_params() click to toggle source
# File lib/wego/client.rb, line 29
def api_params
  Wego.configuration.api_keys.merge(attributes).compact
end
api_path() click to toggle source
# File lib/wego/client.rb, line 25
def api_path
  [Wego.configuration.api_host, end_point].join("/")
end