Class: LunaPark::Notifiers::TaggedLog::Options
- Inherits:
-
Values::Compound
- Object
- Values::Compound
- LunaPark::Notifiers::TaggedLog::Options
- Defined in:
- lib/luna_park/notifiers/tagged_log/options.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#app_env ⇒ Object
readonly
Returns the value of attribute app_env.
-
#default_tag ⇒ Object
readonly
Returns the value of attribute default_tag.
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
-
#min_lvl ⇒ Object
readonly
Returns the value of attribute min_lvl.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Options
constructor
A new instance of Options.
- #merge(other) ⇒ Object
- #merge!(other) ⇒ Notifiers::Log::Options
- #to_h ⇒ Object
Methods inherited from Values::Compound
Methods included from Extensions::Wrappable
Constructor Details
#initialize(attrs = {}) ⇒ Options
Returns a new instance of Options.
11 12 13 14 |
# File 'lib/luna_park/notifiers/tagged_log/options.rb', line 11 def initialize(attrs = {}) logger_conf_error if config_incorrect?(attrs) set_attributes attrs end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
9 10 11 |
# File 'lib/luna_park/notifiers/tagged_log/options.rb', line 9 def app @app end |
#app_env ⇒ Object
Returns the value of attribute app_env.
9 10 11 |
# File 'lib/luna_park/notifiers/tagged_log/options.rb', line 9 def app_env @app_env end |
#default_tag ⇒ Object
Returns the value of attribute default_tag.
9 10 11 |
# File 'lib/luna_park/notifiers/tagged_log/options.rb', line 9 def default_tag @default_tag end |
#instance ⇒ Object
Returns the value of attribute instance.
9 10 11 |
# File 'lib/luna_park/notifiers/tagged_log/options.rb', line 9 def instance @instance end |
#min_lvl ⇒ Object
Returns the value of attribute min_lvl.
9 10 11 |
# File 'lib/luna_park/notifiers/tagged_log/options.rb', line 9 def min_lvl @min_lvl end |
Instance Method Details
#merge(other) ⇒ Object
30 31 32 |
# File 'lib/luna_park/notifiers/tagged_log/options.rb', line 30 def merge(other) dup.merge!(other) end |
#merge!(other) ⇒ Notifiers::Log::Options
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/luna_park/notifiers/tagged_log/options.rb', line 18 def merge!(other) other = self.class.wrap(other) self.default_tag ||= other.default_tag self.app ||= other.app self.app_env ||= other.app_env self.instance ||= other.instance self.min_lvl ||= other.min_lvl self end |
#to_h ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/luna_park/notifiers/tagged_log/options.rb', line 34 def to_h { default_tag: default_tag, app: app, app_env: app_env, instance: instance, min_lvl: min_lvl } end |