class ConsulLoader::ConfigParser

Attributes

config[RW]

Public Class Methods

new() click to toggle source
# File lib/consul_loader/config_parser.rb, line 5
def initialize
  self.config = []
end

Public Instance Methods

process_yaml(root, hash) click to toggle source
# File lib/consul_loader/config_parser.rb, line 9
def process_yaml root, hash
  keys = []
  return [] unless hash

  hash.each do |key, value|
    if value.is_a?(Hash)
      process_yaml(root + "/" + key, value).each do |k|
        keys << k
      end
    else
      keys << {:k => root + "/" + key, :v => value}
    end
  end
  return keys
end