Class: Loggerator::Configuration
- Inherits:
-
Object
- Object
- Loggerator::Configuration
- Defined in:
- lib/loggerator/configuration.rb
Instance Attribute Summary collapse
-
#default_context ⇒ Object
Returns the value of attribute default_context.
-
#metrics_app_name ⇒ Object
Returns the value of attribute metrics_app_name.
-
#rails_default_subscribers ⇒ Object
Returns the value of attribute rails_default_subscribers.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #to_h ⇒ Object
Constructor Details
#initialize(h = {}) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 12 |
# File 'lib/loggerator/configuration.rb', line 5 def initialize(h = {}) @default_context = h[:default_context] || {} @rails_default_subscribers = h[:rails_default_subscribers] || false @metrics_app_name = h[:metrics_app_name] || "loggerator" @stdout = h[:stdout] || $stdout @stderr = h[:stderr] || $stderr end |
Instance Attribute Details
#default_context ⇒ Object
Returns the value of attribute default_context.
3 4 5 |
# File 'lib/loggerator/configuration.rb', line 3 def default_context @default_context end |
#metrics_app_name ⇒ Object
Returns the value of attribute metrics_app_name.
3 4 5 |
# File 'lib/loggerator/configuration.rb', line 3 def metrics_app_name @metrics_app_name end |
#rails_default_subscribers ⇒ Object
Returns the value of attribute rails_default_subscribers.
3 4 5 |
# File 'lib/loggerator/configuration.rb', line 3 def rails_default_subscribers @rails_default_subscribers end |
#stderr ⇒ Object
Returns the value of attribute stderr.
3 4 5 |
# File 'lib/loggerator/configuration.rb', line 3 def stderr @stderr end |
#stdout ⇒ Object
Returns the value of attribute stdout.
3 4 5 |
# File 'lib/loggerator/configuration.rb', line 3 def stdout @stdout end |
Instance Method Details
#to_h ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/loggerator/configuration.rb', line 14 def to_h { default_context: default_context, metrics_app_name: metrics_app_name, rails_default_subscribers: rails_default_subscribers } end |