Class: SoupCMS::CLI::Model::Yaml

Inherits:
Base
  • Object
show all
Defined in:
lib/soupcms/cli/model/yaml.rb

Constant Summary

Constants inherited from Base

Base::SEVERITY_COLOR_MAP

Instance Attribute Summary

Attributes inherited from Base

#file

Instance Method Summary collapse

Methods inherited from Base

#app_name, #build, #coll, #conn, #create, create_model, #db, #doc, #doc_name, #hero_image, #initialize, #model, #old_doc, #publish_in_future?, #slug, #type, #update_old_doc

Constructor Details

This class inherits a constructor from SoupCMS::CLI::Model::Base

Instance Method Details

#parse_fileObject



7
8
9
10
# File 'lib/soupcms/cli/model/yaml.rb', line 7

def parse_file
  document_hash = YAML.load(file.read)
  SoupCMS::CLI::ResolveFileReference.new(File.dirname(file)).parse(document_hash)
end