Class: Musicbrainz::ReleaseGroup
- Inherits:
-
Object
- Object
- Musicbrainz::ReleaseGroup
- Defined in:
- lib/wrapper/resources/release_group.rb
Instance Attribute Summary collapse
-
#artist_credit ⇒ Object
Returns the value of attribute artist_credit.
-
#count ⇒ Object
Returns the value of attribute count.
-
#disambiguation ⇒ Object
Returns the value of attribute disambiguation.
-
#first_release_date ⇒ Object
Returns the value of attribute first_release_date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#primary_type ⇒ Object
Returns the value of attribute primary_type.
-
#releases ⇒ Object
Returns the value of attribute releases.
-
#score ⇒ Object
Returns the value of attribute score.
-
#secondary_types ⇒ Object
Returns the value of attribute secondary_types.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #artists_initialize ⇒ Object
- #child_initializers ⇒ Object
-
#initialize(args) ⇒ ReleaseGroup
constructor
A new instance of ReleaseGroup.
- #releases_initialize ⇒ Object
- #tags_initialize ⇒ Object
Constructor Details
#initialize(args) ⇒ ReleaseGroup
Returns a new instance of ReleaseGroup.
5 6 7 8 9 10 |
# File 'lib/wrapper/resources/release_group.rb', line 5 def initialize args args.each do |k, v| instance_variable_set("@#{k.gsub('-', '_')}", v) unless v.nil? end self.child_initializers end |
Instance Attribute Details
#artist_credit ⇒ Object
Returns the value of attribute artist_credit.
3 4 5 |
# File 'lib/wrapper/resources/release_group.rb', line 3 def artist_credit @artist_credit end |
#count ⇒ Object
Returns the value of attribute count.
3 4 5 |
# File 'lib/wrapper/resources/release_group.rb', line 3 def count @count end |
#disambiguation ⇒ Object
Returns the value of attribute disambiguation.
3 4 5 |
# File 'lib/wrapper/resources/release_group.rb', line 3 def disambiguation @disambiguation end |
#first_release_date ⇒ Object
Returns the value of attribute first_release_date.
3 4 5 |
# File 'lib/wrapper/resources/release_group.rb', line 3 def first_release_date @first_release_date end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/wrapper/resources/release_group.rb', line 3 def id @id end |
#primary_type ⇒ Object
Returns the value of attribute primary_type.
3 4 5 |
# File 'lib/wrapper/resources/release_group.rb', line 3 def primary_type @primary_type end |
#releases ⇒ Object
Returns the value of attribute releases.
3 4 5 |
# File 'lib/wrapper/resources/release_group.rb', line 3 def releases @releases end |
#score ⇒ Object
Returns the value of attribute score.
3 4 5 |
# File 'lib/wrapper/resources/release_group.rb', line 3 def score @score end |
#secondary_types ⇒ Object
Returns the value of attribute secondary_types.
3 4 5 |
# File 'lib/wrapper/resources/release_group.rb', line 3 def secondary_types @secondary_types end |
#tags ⇒ Object
Returns the value of attribute tags.
3 4 5 |
# File 'lib/wrapper/resources/release_group.rb', line 3 def @tags end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/wrapper/resources/release_group.rb', line 3 def title @title end |
Instance Method Details
#artists_initialize ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/wrapper/resources/release_group.rb', line 18 def artists_initialize array = [] self.artist_credit.each do |a| array << Musicbrainz::Artist.new(a["artist"]) if a["artist"] end self.artist_credit = array end |
#child_initializers ⇒ Object
12 13 14 15 16 |
# File 'lib/wrapper/resources/release_group.rb', line 12 def child_initializers self.artists_initialize if self.artist_credit self.releases_initialize if self.releases self. if self. end |
#releases_initialize ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/wrapper/resources/release_group.rb', line 26 def releases_initialize array = [] self.releases.each do |a| array << Musicbrainz::Release.new(a) end self.releases = array end |
#tags_initialize ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/wrapper/resources/release_group.rb', line 34 def array = [] self..each do |a| array << Musicbrainz::Tag.new(a) end self. = array end |