Class: Malt::Formats::YAML
- Defined in:
- lib/malt/formats/yaml.rb
Overview
YAML format
TODO: hmm… maybe use data to update yaml?
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
-
#html ⇒ Object
Converting a plan YAML file to HTML makes no sense so we just wrap it in
pre
tags. - #to_html ⇒ Object
- #to_yaml ⇒ Object (also: #to_yml)
- #yaml ⇒ Object (also: #yml)
Methods inherited from Abstract
#default, engine, #engine, #extensions, extensions, #file, #parse_type_and_data, #refile, register, #render, #subtype, #text, #to, #to_s, #type
Instance Method Details
#html ⇒ Object
Converting a plan YAML file to HTML makes no sense so we just wrap it in pre
tags.
29 30 31 |
# File 'lib/malt/formats/yaml.rb', line 29 def html "<pre>\n#{h text}\n</pre>" end |
#to_html ⇒ Object
34 35 36 37 38 |
# File 'lib/malt/formats/yaml.rb', line 34 def to_html text = html opts = .merge(:text=>text, :file=>refile(:html), :type=>:html) HTML.new(opts) end |
#to_yaml ⇒ Object Also known as: to_yml
21 22 23 |
# File 'lib/malt/formats/yaml.rb', line 21 def to_yaml(*) self end |
#yaml ⇒ Object Also known as: yml
14 15 16 |
# File 'lib/malt/formats/yaml.rb', line 14 def yaml(*) text end |