Class: BandcampDiscover::Roster

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_nameObject (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

#creditsObject (readonly)

Returns the value of attribute credits.



10
11
12
# File 'lib/bandcamp-discover/roster.rb', line 10

def credits
  @credits
end

#releasesObject (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.

Returns:

  • (Boolean)


19
20
21
# File 'lib/bandcamp-discover/roster.rb', line 19

def solo?
  credits.empty? && releases >= 2
end