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.



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

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.



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

def hotentries
  @hotentries
end

Instance Method Details

#auto_mail?Boolean

Returns:

  • (Boolean)


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

def auto_mail?
  auto_mail
end

#connect(downloader) ⇒ Object



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

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

#enable?Boolean

Returns:

  • (Boolean)


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

def enable?
  enable
end