class Kafo::Store
Attributes
Public Class Methods
Source
# File lib/kafo/store.rb, line 7 def initialize(path = nil) @data = {} load_path(path) if path end
Public Instance Methods
Source
# File lib/kafo/store.rb, line 24 def add_dir(path) Dir.glob(File.join(path, "*.yaml")).sort.each do |file| add_file(file) end end
Source
# File lib/kafo/store.rb, line 30 def add_file(file) add(YAML.load_file(file)) end
Source
# File lib/kafo/store.rb, line 12 def load_path(path) if File.directory?(path) add_dir(path) else add_file(path) end end