Class: Tunefind::Client
- Inherits:
-
Object
- Object
- Tunefind::Client
- Defined in:
- lib/tunefind/client.rb
Instance Method Summary collapse
- #get(path) ⇒ Object
-
#initialize(username, password) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(username, password) ⇒ Client
Returns a new instance of Client.
3 4 5 6 |
# File 'lib/tunefind/client.rb', line 3 def initialize(username, password) @username = username @password = password end |
Instance Method Details
#get(path) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# 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 |