Class: PINS::Config
- Inherits:
-
Object
- Object
- PINS::Config
- Defined in:
- lib/postmark-inbound/config.rb
Instance Attribute Summary collapse
-
#dump_errors ⇒ Object
Returns the value of attribute dump_errors.
-
#handler_paths ⇒ Object
Returns the value of attribute handler_paths.
-
#logging ⇒ Object
Returns the value of attribute logging.
-
#passwords ⇒ Object
Returns the value of attribute passwords.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
-
.load_config(path) ⇒ Object
Load Ruby config file.
-
.setup {|Config.shared| ... } ⇒ Object
Call this from your config file.
-
.shared ⇒ PINS::Config
Returns the shared instance.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
36 37 38 39 40 41 |
# File 'lib/postmark-inbound/config.rb', line 36 def initialize @passwords = [] @handler_paths = [] @dump_errors = false @logging = false end |
Instance Attribute Details
#dump_errors ⇒ Object
Returns the value of attribute dump_errors.
33 34 35 |
# File 'lib/postmark-inbound/config.rb', line 33 def dump_errors @dump_errors end |
#handler_paths ⇒ Object
Returns the value of attribute handler_paths.
32 33 34 |
# File 'lib/postmark-inbound/config.rb', line 32 def handler_paths @handler_paths end |
#logging ⇒ Object
Returns the value of attribute logging.
34 35 36 |
# File 'lib/postmark-inbound/config.rb', line 34 def logging @logging end |
#passwords ⇒ Object
Returns the value of attribute passwords.
31 32 33 |
# File 'lib/postmark-inbound/config.rb', line 31 def passwords @passwords end |
#user ⇒ Object
Returns the value of attribute user.
30 31 32 |
# File 'lib/postmark-inbound/config.rb', line 30 def user @user end |
Class Method Details
.load_config(path) ⇒ Object
Load Ruby config file
11 12 13 14 15 16 |
# File 'lib/postmark-inbound/config.rb', line 11 def self.load_config(path) raise 'config file missing' unless path PINS.logger.debug("Loading config file: #{path}") require File.(path) PINS.logger.info('Config.load_config done.') end |
.setup {|Config.shared| ... } ⇒ Object
Call this from your config file
25 26 27 28 |
# File 'lib/postmark-inbound/config.rb', line 25 def self.setup yield Config.shared PINS.logger.debug('Config.setup block executed.') end |
.shared ⇒ PINS::Config
Returns the shared instance
20 21 22 |
# File 'lib/postmark-inbound/config.rb', line 20 def self.shared @shared_config ||= Config.new end |