Class: BBC::Music::Artist
- Inherits:
-
Object
- Object
- BBC::Music::Artist
- Defined in:
- lib/bbc/music/artist.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#links ⇒ Object
readonly
Returns the value of attribute links.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#related_artists ⇒ Object
readonly
Returns the value of attribute related_artists.
-
#releases ⇒ Object
readonly
Returns the value of attribute releases.
-
#reviews ⇒ Object
readonly
Returns the value of attribute reviews.
Class Method Summary collapse
Instance Method Summary collapse
- #get_details ⇒ Object
-
#initialize(params) ⇒ Artist
constructor
A new instance of Artist.
- #to_h ⇒ Object
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(params) ⇒ Artist
Returns a new instance of Artist.
13 14 15 |
# File 'lib/bbc/music/artist.rb', line 13 def initialize(params) populate_from params end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/bbc/music/artist.rb', line 7 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/bbc/music/artist.rb', line 7 def id @id end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
7 8 9 |
# File 'lib/bbc/music/artist.rb', line 7 def image_url @image_url end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
7 8 9 |
# File 'lib/bbc/music/artist.rb', line 7 def links @links end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/bbc/music/artist.rb', line 7 def name @name end |
#related_artists ⇒ Object (readonly)
Returns the value of attribute related_artists.
7 8 9 |
# File 'lib/bbc/music/artist.rb', line 7 def @related_artists end |
#releases ⇒ Object (readonly)
Returns the value of attribute releases.
7 8 9 |
# File 'lib/bbc/music/artist.rb', line 7 def releases @releases end |
#reviews ⇒ Object (readonly)
Returns the value of attribute reviews.
7 8 9 |
# File 'lib/bbc/music/artist.rb', line 7 def reviews @reviews end |
Class Method Details
.find(id) ⇒ Object
9 10 11 |
# File 'lib/bbc/music/artist.rb', line 9 def self.find(id) new(CLIENT.artists(id)) end |
Instance Method Details
#get_details ⇒ Object
17 18 19 20 21 22 |
# File 'lib/bbc/music/artist.rb', line 17 def get_details unless @details_retreived populate_from CLIENT.artists(id) @details_retreived = true end end |
#to_h ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/bbc/music/artist.rb', line 24 def to_h { :id => id, :name => name, :description => description, :releases => releases, :reviews => reviews, :links => links, :image_url => image_url, :related_artists => } end |
#to_json(options = {}) ⇒ Object
37 38 39 |
# File 'lib/bbc/music/artist.rb', line 37 def to_json(={}) JSON.generate(to_h) end |