Class: Musicbrainz::Relation

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Relation

Returns a new instance of Relation.



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

#artistObject

Returns the value of attribute artist.



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

def artist
  @artist
end

#attributesObject

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

#beginObject

Returns the value of attribute begin.



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

def begin
  @begin
end

#directionObject

Returns the value of attribute direction.



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

def direction
  @direction
end

#endObject

Returns the value of attribute end.



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

def end
  @end
end

#endedObject

Returns the value of attribute ended.



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

def ended
  @ended
end

#recordingObject

Returns the value of attribute recording.



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

def recording
  @recording
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

#type_idObject

Returns the value of attribute type_id.



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

def type_id
  @type_id
end

#workObject

Returns the value of attribute work.



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

def work
  @work
end

Instance Method Details

#child_initializersObject



12
13
14
15
16
# File 'lib/wrapper/resources/relation.rb', line 12

def child_initializers
	self.recording = Musicbrainz::Recording.new(self.recording) if self.recording
	self.artist = Musicbrainz::Artist.new(self.artist) if self.artist
	self.work = Musicbrainz::Work.new(self.work) if self.work
end