Class: Redimap::Config
- Inherits:
-
Object
- Object
- Redimap::Config
- Defined in:
- lib/redimap/config.rb
Instance Attribute Summary collapse
-
#imap_host ⇒ Object
Returns the value of attribute imap_host.
-
#imap_mailboxes ⇒ Object
Returns the value of attribute imap_mailboxes.
-
#imap_password ⇒ Object
Returns the value of attribute imap_password.
-
#imap_port ⇒ Object
Returns the value of attribute imap_port.
-
#imap_username ⇒ Object
Returns the value of attribute imap_username.
-
#polling_interval ⇒ Object
Returns the value of attribute polling_interval.
-
#redis_ns_queue ⇒ Object
Returns the value of attribute redis_ns_queue.
-
#redis_ns_redimap ⇒ Object
Returns the value of attribute redis_ns_redimap.
-
#redis_url ⇒ Object
Returns the value of attribute redis_url.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/redimap/config.rb', line 20 def initialize @logger = Redimap.logger @imap_host = ENV['IMAP_HOST'] @imap_port = ENV['IMAP_PORT'] || 993 @imap_username = ENV['IMAP_USERNAME'] @imap_password = ENV['IMAP_PASSWORD'] @imap_mailboxes = JSON.parse(ENV['IMAP_MAILBOXES'] || '["INBOX"]') @redis_url = ENV['REDIS_URL'] || "redis://127.0.0.1:6379/0" @redis_ns_redimap = ENV['REDIS_NS_REDIMAP'] || "redimap" @redis_ns_queue = ENV['REDIS_NS_QUEUE'] || "resque" @polling_interval = (ENV['POLLING_INTERVAL'] || 60).to_i @logger.debug { "Initialized #{to_s}" } end |
Instance Attribute Details
#imap_host ⇒ Object
Returns the value of attribute imap_host.
7 8 9 |
# File 'lib/redimap/config.rb', line 7 def imap_host @imap_host end |
#imap_mailboxes ⇒ Object
Returns the value of attribute imap_mailboxes.
12 13 14 |
# File 'lib/redimap/config.rb', line 12 def imap_mailboxes @imap_mailboxes end |
#imap_password ⇒ Object
Returns the value of attribute imap_password.
10 11 12 |
# File 'lib/redimap/config.rb', line 10 def imap_password @imap_password end |
#imap_port ⇒ Object
Returns the value of attribute imap_port.
8 9 10 |
# File 'lib/redimap/config.rb', line 8 def imap_port @imap_port end |
#imap_username ⇒ Object
Returns the value of attribute imap_username.
9 10 11 |
# File 'lib/redimap/config.rb', line 9 def imap_username @imap_username end |
#polling_interval ⇒ Object
Returns the value of attribute polling_interval.
18 19 20 |
# File 'lib/redimap/config.rb', line 18 def polling_interval @polling_interval end |
#redis_ns_queue ⇒ Object
Returns the value of attribute redis_ns_queue.
16 17 18 |
# File 'lib/redimap/config.rb', line 16 def redis_ns_queue @redis_ns_queue end |
#redis_ns_redimap ⇒ Object
Returns the value of attribute redis_ns_redimap.
15 16 17 |
# File 'lib/redimap/config.rb', line 15 def redis_ns_redimap @redis_ns_redimap end |
#redis_url ⇒ Object
Returns the value of attribute redis_url.
14 15 16 |
# File 'lib/redimap/config.rb', line 14 def redis_url @redis_url end |
Instance Method Details
#to_s ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/redimap/config.rb', line 39 def to_s { :imap_host => @imap_host, :imap_port => @imap_port, :imap_username => @imap_username, :imap_mailboxes => @imap_mailboxes, :redis_url => @redis_url, :redis_ns_redimap => @redis_ns_redimap, :redis_ns_queue => @redis_ns_queue, :polling_interval => @polling_interval, } end |