Class: Mail2WikiHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/helpers/mail2wiki-helper.rb

Constant Summary collapse

DEFAULT_SETTINGS =
{
  :server => 'imap.hermes.cam.ac.uk',
  :username => 'tamc2',
  :password => 'missing_a_password',
  :mailbox => 'test',
  :check_event => :hour,
  :subject_regexp => /.*/,
  :keyword => 'PutInWiki'
}

Instance Method Summary collapse

Constructor Details

#initialize(wiki, settings = {}) ⇒ Mail2WikiHelper



43
44
45
46
47
48
# File 'lib/helpers/mail2wiki-helper.rb', line 43

def initialize( wiki, settings = {} )
  @settings = DEFAULT_SETTINGS.merge( settings )
  @wiki = wiki
  check_mailbox
  @wiki.watch_for(@settings[:check_event]) { check_mailbox }
end