Module: Dato::Dump::Format::Yaml

Defined in:
lib/dato/dump/format/yaml.rb

Class Method Summary collapse

Class Method Details

.dump(value) ⇒ Object



23
24
25
# File 'lib/dato/dump/format/yaml.rb', line 23

def self.dump(value)
  YAML.dump(value.deep_stringify_keys).chomp.gsub(/^-+\n/, "")
end

.frontmatter_dump(value) ⇒ Object



27
28
29
# File 'lib/dato/dump/format/yaml.rb', line 27

def self.frontmatter_dump(value)
  "---\n#{dump(value)}\n---"
end