Class: TraceViz::Configuration
- Inherits:
-
Object
- Object
- TraceViz::Configuration
- Defined in:
- lib/trace_viz/configuration.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #dup ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset_defaults ⇒ Object
- #update(group, values) ⇒ Object
Constructor Details
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
9 10 11 |
# File 'lib/trace_viz/configuration.rb', line 9 def logger @logger end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
9 10 11 |
# File 'lib/trace_viz/configuration.rb', line 9 def settings @settings end |
Instance Method Details
#[](key) ⇒ Object
19 20 21 |
# File 'lib/trace_viz/configuration.rb', line 19 def [](key) settings[key] end |
#dup ⇒ Object
38 39 40 |
# File 'lib/trace_viz/configuration.rb', line 38 def dup Config::Copier.new(self).copy end |
#reset_defaults ⇒ Object
34 35 36 |
# File 'lib/trace_viz/configuration.rb', line 34 def reset_defaults @settings = Defaults::Config.fetch end |
#update(group, values) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/trace_viz/configuration.rb', line 23 def update(group, values) raise ArgumentError, "Invalid configuration group: #{group}" unless settings.key?(group) @validator.validate(group, values) if settings[group].is_a?(Hash) settings[group].merge!(values) else settings[group] = values end end |