Class: Data::Migrators::Yaml
- Inherits:
-
Object
- Object
- Data::Migrators::Yaml
- Defined in:
- app/services/flexite/data/migrators/yaml.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize ⇒ Yaml
constructor
A new instance of Yaml.
Constructor Details
#initialize ⇒ Yaml
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
#call ⇒ Object
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 |