class Tunefind::Client

Public Class Methods

new(username, password) click to toggle source
# File lib/tunefind/client.rb, line 3
def initialize(username, password)
  @username = username
  @password = password
end

Public Instance Methods

get(path) click to toggle source
# File lib/tunefind/client.rb, line 8
def get(path)
  JSON.load(RestClient::Request.new(
    method: :get,
    url: build_url(path),
    user: @username,
    password: @password,
    headers: { accept: :json, content_type: :json }
  ).execute)
end

Private Instance Methods

build_url(path) click to toggle source
# File lib/tunefind/client.rb, line 20
def build_url(path)
  endpoint + path
end
endpoint() click to toggle source
# File lib/tunefind/client.rb, line 24
def endpoint
  "https://www.tunefind.com/api/v1/"
end