Module: RoviAPI
- Defined in:
- lib/rovi_api.rb,
lib/rovi_api/client.rb,
lib/rovi_api/service.rb,
lib/rovi_api/version.rb,
lib/rovi_api/endpoint.rb,
lib/rovi_api/services/data.rb,
lib/rovi_api/services/recs.rb,
lib/rovi_api/endpoints/name.rb,
lib/rovi_api/endpoints/song.rb,
lib/rovi_api/endpoints/album.rb,
lib/rovi_api/endpoints/music.rb,
lib/rovi_api/services/search.rb
Defined Under Namespace
Modules: Endpoints, Services Classes: Client, Endpoint, Service
Constant Summary collapse
- VERSION =
"0.1.0"
Class Attribute Summary collapse
-
.host ⇒ Object
Returns the value of attribute host.
-
.key ⇒ Object
Returns the value of attribute key.
-
.secret ⇒ Object
Returns the value of attribute secret.
Class Method Summary collapse
Class Attribute Details
.host ⇒ Object
Returns the value of attribute host.
17 18 19 |
# File 'lib/rovi_api.rb', line 17 def host @host end |
.key ⇒ Object
Returns the value of attribute key.
17 18 19 |
# File 'lib/rovi_api.rb', line 17 def key @key end |
.secret ⇒ Object
Returns the value of attribute secret.
17 18 19 |
# File 'lib/rovi_api.rb', line 17 def secret @secret end |
Class Method Details
.client ⇒ Object
24 25 26 27 |
# File 'lib/rovi_api.rb', line 24 def self.client raise "RoviAPI.key and RoviAPI.secret must be set" unless key && secret @client ||= Client.new end |
.connection ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/rovi_api.rb', line 29 def self.connection Faraday.new(host) do |c| c.adapter Faraday.default_adapter c.headers["Accept"] = "application/json" c.response :rashify c.response :raise_error c.response :json, content_type: /\bjson$/ end end |