Class: Serega::SeregaPlugins::Formatters::FormattersConfig
- Inherits:
-
Object
- Object
- Serega::SeregaPlugins::Formatters::FormattersConfig
- Defined in:
- lib/serega/plugins/formatters/formatters.rb
Overview
Formatters plugin config
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#add(formatters) ⇒ void
Adds new formatters.
-
#initialize(opts) ⇒ Object
constructor
Initializes formatters config object.
Constructor Details
#initialize(opts) ⇒ Object
Initializes formatters config object
109 110 111 |
# File 'lib/serega/plugins/formatters/formatters.rb', line 109 def initialize(opts) @opts = opts end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
101 102 103 |
# File 'lib/serega/plugins/formatters/formatters.rb', line 101 def opts @opts end |
Instance Method Details
#add(formatters) ⇒ void
This method returns an undefined value.
Adds new formatters
119 120 121 122 123 124 |
# File 'lib/serega/plugins/formatters/formatters.rb', line 119 def add(formatters) formatters.each_pair do |key, value| CheckFormatter.call(key, value) opts[key] = value end end |