Class: Superbolt::Config
- Inherits:
-
Object
- Object
- Superbolt::Config
- Defined in:
- lib/superbolt/config.rb
Instance Attribute Summary collapse
- #app_name ⇒ Object
- #env ⇒ Object
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #connection_params ⇒ Object
- #default ⇒ Object
- #env_connection_key ⇒ Object
- #env_params ⇒ Object
- #error_notifier ⇒ Object
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
- #runner ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
6 7 8 |
# File 'lib/superbolt/config.rb', line 6 def initialize(={}) @options = end |
Instance Attribute Details
#app_name ⇒ Object
10 11 12 |
# File 'lib/superbolt/config.rb', line 10 def app_name @app_name ||= [:app_name] end |
#env ⇒ Object
14 15 16 |
# File 'lib/superbolt/config.rb', line 14 def env @env ||= [:env] end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/superbolt/config.rb', line 3 def @options end |
Instance Method Details
#==(other) ⇒ Object
42 43 44 45 |
# File 'lib/superbolt/config.rb', line 42 def ==(other) other.connection_params == connection_params && other.env_connection_key == env_connection_key end |
#connection_params ⇒ Object
18 19 20 |
# File 'lib/superbolt/config.rb', line 18 def connection_params env_params || default end |
#default ⇒ Object
38 39 40 |
# File 'lib/superbolt/config.rb', line 38 def default [:connection_params] || {host: '127.0.0.1'} end |
#env_connection_key ⇒ Object
22 23 24 |
# File 'lib/superbolt/config.rb', line 22 def env_connection_key [:connection_key] || 'RABBITMQ_URL' end |
#env_params ⇒ Object
34 35 36 |
# File 'lib/superbolt/config.rb', line 34 def env_params ENV[env_connection_key] end |
#error_notifier ⇒ Object
30 31 32 |
# File 'lib/superbolt/config.rb', line 30 def error_notifier [:error_notifier] end |
#runner ⇒ Object
26 27 28 |
# File 'lib/superbolt/config.rb', line 26 def runner [:runner] end |