Class: Rhapsody::Request
- Inherits:
-
Object
- Object
- Rhapsody::Request
- Defined in:
- lib/rhapsody/request.rb
Constant Summary collapse
- HOST_URL =
'https://api.rhapsody.com'
Instance Attribute Summary collapse
-
#faraday ⇒ Object
Returns the value of attribute faraday.
Instance Method Summary collapse
-
#initialize(options) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(options) ⇒ Request
Returns a new instance of Request.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rhapsody/request.rb', line 8 def initialize() @faraday = Faraday.new(:url => HOST_URL) do |faraday| faraday.request :url_encoded faraday.adapter Faraday.default_adapter if [:access_token] faraday. :Bearer, [:access_token] end if [:api_key] && [:api_secret] faraday.basic_auth([:api_key], [:api_secret]) end end end |
Instance Attribute Details
#faraday ⇒ Object
Returns the value of attribute faraday.
6 7 8 |
# File 'lib/rhapsody/request.rb', line 6 def faraday @faraday end |