Class: Songlink
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#url ⇒ Object
Returns the value of attribute url.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(api_key = ENV['SONGLINK_API_KEY']) ⇒ Songlink
constructor
A new instance of Songlink.
- #request(params = {}) ⇒ Object
Methods included from Request
Methods included from Version
Constructor Details
#initialize(api_key = ENV['SONGLINK_API_KEY']) ⇒ Songlink
11 12 13 14 15 16 |
# File 'lib/songlink.rb', line 11 def initialize(api_key = ENV['SONGLINK_API_KEY']) @version = Version.version @api_version = Version.api_version @api_key = api_key @url = Request.base_url end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/songlink.rb', line 9 def api_key @api_key end |
#api_version ⇒ Object
Returns the value of attribute api_version.
9 10 11 |
# File 'lib/songlink.rb', line 9 def api_version @api_version end |
#url ⇒ Object
Returns the value of attribute url.
9 10 11 |
# File 'lib/songlink.rb', line 9 def url @url end |
#version ⇒ Object
Returns the value of attribute version.
9 10 11 |
# File 'lib/songlink.rb', line 9 def version @version end |
Instance Method Details
#request(params = {}) ⇒ Object
18 19 20 |
# File 'lib/songlink.rb', line 18 def request(params = {}) http.get("/#{api_version}/links", _params(params)) end |