Sha256: 75bbe78c15b22b62049093f2d6b95f5dee7d8b8a4d496d2913e3c751085b730e

Contents?: true

Size: 672 Bytes

Versions: 25

Compression:

Stored size: 672 Bytes

Contents

# frozen_string_literal: true

#
# Copyright 2013 whiteleaf. All rights reserved.
#

class HotentryManager
  attr_reader :hotentries

  def initialize
    inv = Inventory.load("local_setting")
    self.enable = inv["hotentry"]
    self.auto_mail = inv["hotentry.auto-mail"]
    self.hotentries = {}
  end

  def connect(downloader)
    return unless enable?
    downloader.on(:newarrival, &method(:store_entry))
  end

  def enable?
    enable
  end

  def auto_mail?
    auto_mail
  end

  private

  attr_accessor :enable, :auto_mail
  attr_writer :hotentries

  def store_entry(hash)
    entry = hotentries[hash[:id]] ||= []
    entry << hash[:subtitle_info]
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
narou-3.9.1 lib/command/update/hotentry_manager.rb
narou-3.9.0 lib/command/update/hotentry_manager.rb
narou-3.8.2 lib/command/update/hotentry_manager.rb
narou-3.8.1 lib/command/update/hotentry_manager.rb
narou-3.8.0 lib/command/update/hotentry_manager.rb
narou-3.7.2 lib/command/update/hotentry_manager.rb
narou-3.7.1 lib/command/update/hotentry_manager.rb
narou-3.7.0 lib/command/update/hotentry_manager.rb
narou-3.6.0 lib/command/update/hotentry_manager.rb
narou-3.5.1 lib/command/update/hotentry_manager.rb
narou-3.5.0.1 lib/command/update/hotentry_manager.rb
narou-3.5.0 lib/command/update/hotentry_manager.rb
narou-3.4.8 lib/command/update/hotentry_manager.rb
narou-3.4.7.1 lib/command/update/hotentry_manager.rb
narou-3.4.7 lib/command/update/hotentry_manager.rb
narou-3.4.6.1 lib/command/update/hotentry_manager.rb
narou-3.4.6 lib/command/update/hotentry_manager.rb
narou-3.4.5 lib/command/update/hotentry_manager.rb
narou-3.4.3 lib/command/update/hotentry_manager.rb
narou-3.4.2 lib/command/update/hotentry_manager.rb