lib/config_volumizer/parser.rb in config_volumizer-0.1.0 vs lib/config_volumizer/parser.rb in config_volumizer-0.2.0
- old
+ new
@@ -4,9 +4,17 @@
module ConfigVolumizer
module Parser
class << self
+ # Parses keys within the {source} hash matching {base_name}
+ # returning a hash with all the matched data under a string key matching the {base_name}
+ #
+ # See Readme for an example
+ #
+ # @param [Hash] source
+ # @param [String] base_name
+ # @return [Hash]
def parse(source, base_name)
result = {}
source.each do |key, value|
if matches_name(base_name, key)
fragments = key.gsub(/^#{base_name}/, '')