Module: Dato::Dump::Format
- Defined in:
- lib/dato/dump/format.rb,
lib/dato/dump/format/toml.rb,
lib/dato/dump/format/yaml.rb
Defined Under Namespace
Class Method Summary collapse
- .converter_for(format) ⇒ Object
- .dump(format, value) ⇒ Object
- .frontmatter_dump(format, value) ⇒ Object
Class Method Details
.converter_for(format) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/dato/dump/format.rb', line 16 def self.converter_for(format) case format.to_sym when :toml Format::Toml when :yaml, :yml Format::Yaml end end |
.dump(format, value) ⇒ Object
8 9 10 |
# File 'lib/dato/dump/format.rb', line 8 def self.dump(format, value) converter_for(format).dump(value) end |
.frontmatter_dump(format, value) ⇒ Object
12 13 14 |
# File 'lib/dato/dump/format.rb', line 12 def self.frontmatter_dump(format, value) converter_for(format).frontmatter_dump(value) end |