Class: BandcampDiscover::Roster
- Inherits:
-
Object
- Object
- BandcampDiscover::Roster
- Defined in:
- lib/bandcamp-discover/roster.rb
Overview
A label's /music grid credits each release to its artist; an artist's own page credits nothing, because the artist is the page. That is the one structural difference between the two, and it costs no API call.
It only ever says "no": one person releasing under aliases looks like a roster, and a bio can say "not a label" over a grid full of credits, so a positive still has to come from the bio.
Instance Attribute Summary collapse
-
#band_name ⇒ Object
readonly
Returns the value of attribute band_name.
-
#credits ⇒ Object
readonly
Returns the value of attribute credits.
-
#releases ⇒ Object
readonly
Returns the value of attribute releases.
Instance Method Summary collapse
-
#initialize(band_name:, credits:, releases: credits.size) ⇒ Roster
constructor
A new instance of Roster.
-
#solo? ⇒ Boolean
A single self-released record is not evidence either way.
Constructor Details
#initialize(band_name:, credits:, releases: credits.size) ⇒ Roster
Returns a new instance of Roster.
12 13 14 15 16 |
# File 'lib/bandcamp-discover/roster.rb', line 12 def initialize(band_name:, credits:, releases: credits.size) @band_name = band_name.to_s.strip @releases = releases @credits = credits.compact.map(&:strip).reject { |credit| credit.empty? || own?(credit) }.uniq end |
Instance Attribute Details
#band_name ⇒ Object (readonly)
Returns the value of attribute band_name.
10 11 12 |
# File 'lib/bandcamp-discover/roster.rb', line 10 def band_name @band_name end |
#credits ⇒ Object (readonly)
Returns the value of attribute credits.
10 11 12 |
# File 'lib/bandcamp-discover/roster.rb', line 10 def credits @credits end |
#releases ⇒ Object (readonly)
Returns the value of attribute releases.
10 11 12 |
# File 'lib/bandcamp-discover/roster.rb', line 10 def releases @releases end |
Instance Method Details
#solo? ⇒ Boolean
A single self-released record is not evidence either way.
19 20 21 |
# File 'lib/bandcamp-discover/roster.rb', line 19 def solo? credits.empty? && releases >= 2 end |