Class: Databasion::YamlBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/databasion/yaml_builder.rb

Class Method Summary collapse

Class Method Details

.run(data_hash, config = nil, opts = nil) ⇒ Object

Raises:

  • (YamalizeError)


9
10
11
12
13
14
15
16
17
18
# File 'lib/databasion/yaml_builder.rb', line 9

def self.run(data_hash, config=nil, opts=nil)
  raise YamalizeError, 'Databasion::YamlBuilder requires an output path.' if config['output']['yaml_path'].nil?
  @@config = config
  @@environment = opts[:env]
  
  Databasion::LOGGER.info "Yamlbating %s..." % data_hash['name']

  yaml_output = process(data_hash)
  write(data_hash['name'], yaml_output)
end