Class: Openlive::Artist
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.all ⇒ Array<Artist>
Fetch and return a list of all artists.
-
.create(attributes) ⇒ Artist
Create a new artist on Openlive.
-
.find(id) ⇒ Artist
Find and return an artist record.
Methods inherited from Base
connection, #connection, handle_response, #initialize, #method_missing, #oauth, oauth, #refresh
Constructor Details
This class inherits a constructor from Openlive::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Openlive::Base
Class Method Details
.all ⇒ Array<Artist>
Fetch and return a list of all artists
36 37 38 39 40 41 42 43 44 |
# File 'lib/openlive/artist.rb', line 36 def all response = Request.get("artists") handle_response(response, error_class: APIError) do |response| response.body['data'].map do |a| new(a, response: response) end end end |
.create(attributes) ⇒ Artist
Create a new artist on Openlive
24 25 26 27 28 29 30 |
# File 'lib/openlive/artist.rb', line 24 def create(attributes) response = Request.post("artists", attributes) handle_response(response, error_class: APIError) do |response| new(response.body, response: response) end end |