Class: MailRoom::Configuration
- Inherits:
-
Object
- Object
- MailRoom::Configuration
- Defined in:
- lib/mail_room/configuration.rb
Overview
Wraps configuration for a set of individual mailboxes with global config
Instance Attribute Summary collapse
-
#daemonize ⇒ Object
Returns the value of attribute daemonize.
-
#log_path ⇒ Object
Returns the value of attribute log_path.
-
#mailboxes ⇒ Object
Returns the value of attribute mailboxes.
-
#pid_path ⇒ Object
Returns the value of attribute pid_path.
-
#quiet ⇒ Object
Returns the value of attribute quiet.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Configuration
constructor
Initialize a new configuration of mailboxes.
-
#set_mailboxes(mailboxes_config) ⇒ Object
Builds individual mailboxes from YAML configuration.
Constructor Details
#initialize(options = {}) ⇒ Configuration
Initialize a new configuration of mailboxes
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mail_room/configuration.rb', line 8 def initialize(={}) self.mailboxes = [] self.quiet = .fetch(:quiet, false) if .has_key?(:config_path) begin config_file = YAML.load_file([:config_path]) set_mailboxes(config_file[:mailboxes]) rescue => e raise e unless quiet end end end |
Instance Attribute Details
#daemonize ⇒ Object
Returns the value of attribute daemonize.
5 6 7 |
# File 'lib/mail_room/configuration.rb', line 5 def daemonize @daemonize end |
#log_path ⇒ Object
Returns the value of attribute log_path.
5 6 7 |
# File 'lib/mail_room/configuration.rb', line 5 def log_path @log_path end |
#mailboxes ⇒ Object
Returns the value of attribute mailboxes.
5 6 7 |
# File 'lib/mail_room/configuration.rb', line 5 def mailboxes @mailboxes end |
#pid_path ⇒ Object
Returns the value of attribute pid_path.
5 6 7 |
# File 'lib/mail_room/configuration.rb', line 5 def pid_path @pid_path end |
#quiet ⇒ Object
Returns the value of attribute quiet.
5 6 7 |
# File 'lib/mail_room/configuration.rb', line 5 def quiet @quiet end |