Sha256: 40676e886c792aa3af27819737fc013241cd8c9e7eaa2abb11fec981d1d10d10

Contents?: true

Size: 665 Bytes

Versions: 19

Compression:

Stored size: 665 Bytes

Contents

# -*- coding: utf-8 -*-
#
# 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

19 entries across 19 versions & 1 rubygems

Version Path
narou-3.2.5.1 lib/command/update/hotentry_manager.rb
narou-3.2.5 lib/command/update/hotentry_manager.rb
narou-3.2.4 lib/command/update/hotentry_manager.rb
narou-3.2.3 lib/command/update/hotentry_manager.rb
narou-3.2.2 lib/command/update/hotentry_manager.rb
narou-3.2.1 lib/command/update/hotentry_manager.rb
narou-3.2.0.1 lib/command/update/hotentry_manager.rb
narou-3.2.0 lib/command/update/hotentry_manager.rb
narou-3.1.11 lib/command/update/hotentry_manager.rb
narou-3.1.10 lib/command/update/hotentry_manager.rb
narou-3.1.9 lib/command/update/hotentry_manager.rb
narou-3.1.8 lib/command/update/hotentry_manager.rb
narou-3.1.7 lib/command/update/hotentry_manager.rb
narou-3.1.6 lib/command/update/hotentry_manager.rb
narou-3.1.5 lib/command/update/hotentry_manager.rb
narou-3.1.4 lib/command/update/hotentry_manager.rb
narou-3.1.3 lib/command/update/hotentry_manager.rb
narou-3.1.2 lib/command/update/hotentry_manager.rb
narou-3.1.1 lib/command/update/hotentry_manager.rb