Class: Echonest::ApiMethods::Artist

Inherits:
Base
  • Object
show all
Defined in:
lib/echonest/api.rb

Instance Attribute Summary collapse

Class Method Summary collapse

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_idObject

Returns the value of attribute artist_id.



300
301
302
# File 'lib/echonest/api.rb', line 300

def artist_id
  @artist_id
end

#artist_nameObject

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