Class: Echonest::ApiMethods::Artist
Instance Attribute Summary collapse
-
#artist_id ⇒ Object
Returns the value of attribute artist_id.
-
#artist_name ⇒ Object
Returns the value of attribute artist_name.
Class Method Summary collapse
- .method_with_artist_id(method_id, option, &block) ⇒ Object
- .new_from_name(echonest, artist_name) ⇒ Object
Methods inherited from Base
build_params_with_validation, #initialize, method_with_option, method_with_required_any, #request, validator
Constructor Details
This class inherits a constructor from Echonest::ApiMethods::Base
Instance Attribute Details
#artist_id ⇒ Object
Returns the value of attribute artist_id.
300 301 302 |
# File 'lib/echonest/api.rb', line 300 def artist_id @artist_id end |
#artist_name ⇒ Object
Returns the value of attribute artist_name.
300 301 302 |
# File 'lib/echonest/api.rb', line 300 def artist_name @artist_name end |
Class Method Details
.method_with_artist_id(method_id, option, &block) ⇒ Object
292 293 294 295 296 297 |
# File 'lib/echonest/api.rb', line 292 def method_with_artist_id(method_id, option, &block) required_any = %w[id name] http_method = :get proc = lambda {|s| s.artist_name ? {:name => s.artist_name} : {:id => s.artist_id} } method_with_required_any('artist', method_id, http_method, [], required_any, option, proc, block) end |
.new_from_name(echonest, artist_name) ⇒ Object
286 287 288 289 290 |
# File 'lib/echonest/api.rb', line 286 def new_from_name(echonest, artist_name) instance = new(echonest) instance.artist_name = artist_name instance end |