Class: Franz::Config
- Inherits:
-
Object
- Object
- Franz::Config
- Defined in:
- lib/franz/config.rb
Overview
All things configuration.
Class Method Summary collapse
-
.new(path) ⇒ Hash
Load a config file path into a Hash, converting to some native types where appropriate (e.g. a String denoting a Regexp will become Regexp).
Class Method Details
.new(path) ⇒ Hash
Load a config file path into a Hash, converting to some native types where appropriate (e.g. a String denoting a Regexp will become Regexp).
14 15 16 17 18 19 20 21 22 |
# File 'lib/franz/config.rb', line 14 def self.new path config = JSON::parse File.read(path), symbolize_names: true config[:input][:configs].map! do |input| input[:multiline] = Regexp.new input[:multiline] if input.has_key?(:multiline) input[:type] = input[:type].to_sym input end return config end |