class MyManga::CLI::Commands::Update

See desc

Public Instance Methods

call(names: nil, **options) click to toggle source
# File lib/my_manga/update.rb, line 11
def call(names: nil, **options)
  names = manga_names(names)

  puts 'Fetching Manga'
  puts '...'

  names.each do |name|
    manga = MyManga[name]
    old_total = manga.total_count
    MyManga.update(manga)
    new_total = MyManga[name].total_count
    updated = new_total - old_total

    next if updated.zero?

    puts "Updated \"#{name}\": #{updated} new Chapters."
  end
end