Class: Data::Migrators::Yaml

Inherits:
Object
  • Object
show all
Defined in:
app/services/flexite/data/migrators/yaml.rb

Instance Method Summary collapse

Constructor Details

#initializeYaml

Returns a new instance of Yaml.



3
4
5
6
7
8
# File 'app/services/flexite/data/migrators/yaml.rb', line 3

def initialize
  @paths = Flexite.config.paths
  @roots = Flexite.config.source_roots
  @hierarchy = Flexite.config.hierarchy
  @data = Data::Hash.new
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
# File 'app/services/flexite/data/migrators/yaml.rb', line 10

def call
  @paths.each_with_object(@data) do |(name, paths), data|
    paths.each do |p|
      next unless File.exists?(p)
      load_data(data, name, p)
    end
  end
end