Class: Musicbrainz::Release

Inherits:
Object
  • Object
show all
Defined in:
lib/wrapper/resources/release.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Release

Returns a new instance of Release.



5
6
7
8
9
10
# File 'lib/wrapper/resources/release.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

#areaObject

Returns the value of attribute area.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def area
  @area
end

#artist_creditObject

Returns the value of attribute artist_credit.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def artist_credit
  @artist_credit
end

#asinObject

Returns the value of attribute asin.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def asin
  @asin
end

#barcodeObject

Returns the value of attribute barcode.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def barcode
  @barcode
end

#countObject

Returns the value of attribute count.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def count
  @count
end

#countryObject

Returns the value of attribute country.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def country
  @country
end

#cover_art_archiveObject

Returns the value of attribute cover_art_archive.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def cover_art_archive
  @cover_art_archive
end

#dateObject

Returns the value of attribute date.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def date
  @date
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def id
  @id
end

#label_infoObject

Returns the value of attribute label_info.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def label_info
  @label_info
end

#mediaObject

Returns the value of attribute media.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def media
  @media
end

#packshotObject

Returns the value of attribute packshot.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def packshot
  @packshot
end

#qualityObject

Returns the value of attribute quality.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def quality
  @quality
end

#relationsObject

Returns the value of attribute relations.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def relations
  @relations
end

#release_eventsObject

Returns the value of attribute release_events.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def release_events
  @release_events
end

#release_groupObject

Returns the value of attribute release_group.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def release_group
  @release_group
end

#scoreObject

Returns the value of attribute score.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def score
  @score
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def status
  @status
end

#text_representationObject

Returns the value of attribute text_representation.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def text_representation
  @text_representation
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def title
  @title
end

#track_countObject

Returns the value of attribute track_count.



3
4
5
# File 'lib/wrapper/resources/release.rb', line 3

def track_count
  @track_count
end

Instance Method Details

#artists_initializeObject



24
25
26
27
28
29
30
# File 'lib/wrapper/resources/release.rb', line 24

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_initializersObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/wrapper/resources/release.rb', line 12

def child_initializers
	self.area = Musicbrainz::Area.new(self.area) if self.area
	self.text_representation = Musicbrainz::TextRepresentation.new(self.text_representation) if self.text_representation
	self.release_group = Musicbrainz::ReleaseGroup.new(self.release_group) if self.release_group
	self.cover_art_archive = Musicbrainz::CoverArtArchive.new(self.cover_art_archive) if self.cover_art_archive
	self.artists_initialize if self.artist_credit
	self.media_initialize if self.media
	self.label_info_initialize if self.label_info
	self.release_events_initialize if self.release_events
	self.relations_initialize if self.relations
end

#label_info_initializeObject



40
41
42
43
44
45
46
# File 'lib/wrapper/resources/release.rb', line 40

def label_info_initialize
	array = []
	self.label_info.each do |a|
		array << Musicbrainz::LabelInfo.new(a)
	end
	self.label_info = array
end

#media_initializeObject



32
33
34
35
36
37
38
# File 'lib/wrapper/resources/release.rb', line 32

def media_initialize
	array = []
	self.media.each do |a|
		array << Musicbrainz::Media.new(a)
	end
	self.media = array
end

#relations_initializeObject



56
57
58
59
60
61
62
# File 'lib/wrapper/resources/release.rb', line 56

def relations_initialize
	array = []
	self.relations.each do |a|
		array << Musicbrainz::Relation.new(a)
	end
	self.relations = array
end

#release_events_initializeObject



48
49
50
51
52
53
54
# File 'lib/wrapper/resources/release.rb', line 48

def release_events_initialize
	array = []
	self.release_events.each do |a|
		array << Musicbrainz::ReleaseEvent.new(a)
	end
	self.release_events = array
end