class WishlistPopulator

Attributes

wishlist[R]

Public Class Methods

new(wishlist:) click to toggle source
# File lib/discogs/wishlist/populators/wishlist_populator.rb, line 4
def initialize(wishlist:)
  @wishlist = wishlist
end

Public Instance Methods

populate!() click to toggle source
# File lib/discogs/wishlist/populators/wishlist_populator.rb, line 8
def populate!
  wantlist = discogs_api.fetch_by_username(wishlist.username)

  wantlist.each do |wantlist_item|
    wishlist.add_to_wishlist(wantlist_item)
  end
end

Private Instance Methods

discogs_api() click to toggle source
# File lib/discogs/wishlist/populators/wishlist_populator.rb, line 20
def discogs_api
  @discogs_api ||= DiscogsApi.new
end