[Rbrainz-users] using MusicBrainz::Model::Artist

Armin Otto arminotto at googlemail.com
Thu Aug 9 11:24:18 EDT 2007


been playing around with the rbrainz library in rails again.

For starters i wanted to get some artist information.

so, my controller gets:

@query  = MusicBrainz::Webservice::Query.new
@filter = MusicBrainz::Webservice::ArtistFilter.new(:name => "Michael
@results = @query.get_artists(@filter)

in the matching view i wanted to print out the content of each result.
Sinc the MusicBrainz::Model::Artist class isn't really documented I looked
the attributes up with .inspect and tried to display them in the view:

<% @results.each do |x| %>
<td><%=h x.score %></td>
<td><%=h x.entity.aliases.count %></td>
<td><%=h x.entity.aliases.entries %></td>
<td><%=h x.entity.aliases.offset %></td>
<td><%=h x.entity.begin_date %></td>
<td><%=h x.entity.disambiguation %></td>
<td><%=h x.entity.end_date %></td>
<td><%=h x.entity.id.entity %></td>
<td><%=h x.entity.id.uuid %></td>
<td><%=h x.entity.name %></td>
<td><%=h x.entity.releases.count %></td>
<td><%=h x.entity.releases.entries %></td>
<td><%=h x.entity.releases.offset %></td>
<td><%=h x.entity.sort_name %></td>
<td><%=h x.entity.tags.count %></td>
<td><%=h x.entity.tags.entries %></td>
<td><%=h x.entity.tags.offset %></td>
<td><%=h x.entity.type %></td>

Those work find, however, when I try to access the @relations attribute, i
Is that intentional and what is that thing for ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rbrainz-users/attachments/20070809/fcb4c8e3/attachment-0001.html 

More information about the Rbrainz-users mailing list