Class: Lastrb::Artist

Inherits:
Base
  • Object
show all
Defined in:
lib/lastrb/artist.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Artist

Returns a new instance of Artist.



7
8
9
10
# File 'lib/lastrb/artist.rb', line 7

def initialize(name)
  self.artist = name
  super
end

Instance Attribute Details

#artistObject

Returns the value of attribute artist.



3
4
5
# File 'lib/lastrb/artist.rb', line 3

def artist
  @artist
end

#usernameObject

Returns the value of attribute username.



4
5
6
# File 'lib/lastrb/artist.rb', line 4

def username
  @username
end

Instance Method Details

#get_info(query = {}, options = {}) ⇒ Object



12
13
14
15
16
17
# File 'lib/lastrb/artist.rb', line 12

def get_info(query = {}, options={})
  query.merge!({ :method => 'artist.getinfo', :artist => self.artist })
  options.merge!({ :query => query})

  self.class.get('/', options)
end

#search(query = {}, options = {}) ⇒ Object



19
20
21
22
23
24
# File 'lib/lastrb/artist.rb', line 19

def search(query = {}, options={})
  query.merge!({ :method => 'artist.search', :artist => self.artist })
  options.merge!({ :query => query})

  self.class.get('/', options)
end