Class: RockdoveServer
- Inherits:
-
Object
- Object
- RockdoveServer
- Defined in:
- lib/rockdove/script/rockdove_server.rb
Instance Method Summary collapse
-
#initialize ⇒ RockdoveServer
constructor
A new instance of RockdoveServer.
- #process_rockdove_job ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize ⇒ RockdoveServer
Returns a new instance of RockdoveServer.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rockdove/script/rockdove_server.rb', line 12 def initialize Rockdove::Config.configure do |config| # (EDIT THIS CONTENT BELOW) config.ews_url 'https://ewsdomain.com/ews/exchange.asmx' config.ews_username 'ews_username' config.ews_password 'ews_password' config.ews_folder 'Inbox' # ews_folder is Inbox by default config.ews_archive_folder 'Archive' # by default, it deletes the mail after processing, mention ews_archive_folder if it # has to be archived to a different folder config.ews_watch_interval 60 # by default, the polling interval is 60 config.ews_ignore_mails ["[email protected]"] # an array of emails to be ignored end #Raad.env = "production" end |
Instance Method Details
#process_rockdove_job ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rockdove/script/rockdove_server.rb', line 36 def process_rockdove_job Rockdove::CollectMail.watch do |rockdove_parsed_mail| begin #Model.method(rockdove_parsed_mail) (EDIT THIS) rescue Exception => e Rockdove.logger.error "Exception occurred while receiving message:\n#{rockdove_parsed_mail}" Rockdove.logger.error [e, *e.backtrace].join("\n") end end end |
#start ⇒ Object
27 28 29 30 |
# File 'lib/rockdove/script/rockdove_server.rb', line 27 def start Raad::Logger.debug("Rockdove Daemon started in #{Raad.env} env") process_rockdove_job end |
#stop ⇒ Object
32 33 34 |
# File 'lib/rockdove/script/rockdove_server.rb', line 32 def stop Raad::Logger.debug("Rockdove Daemon stopped") end |