Class: HotentryManager

Inherits:
Object
  • Object
show all
Defined in:
lib/command/update/hotentry_manager.rb

Overview

Copyright 2013 whiteleaf. All rights reserved.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHotentryManager

Returns a new instance of HotentryManager.



10
11
12
13
14
15
# File 'lib/command/update/hotentry_manager.rb', line 10

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

Instance Attribute Details

#hotentriesObject

Returns the value of attribute hotentries.



8
9
10
# File 'lib/command/update/hotentry_manager.rb', line 8

def hotentries
  @hotentries
end

Instance Method Details

#auto_mail?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/command/update/hotentry_manager.rb', line 26

def auto_mail?
  auto_mail
end

#connect(downloader) ⇒ Object



17
18
19
20
# File 'lib/command/update/hotentry_manager.rb', line 17

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

#enable?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/command/update/hotentry_manager.rb', line 22

def enable?
  enable
end