Class: Sidenotes::Formatter
- Inherits:
-
Object
- Object
- Sidenotes::Formatter
- Defined in:
- lib/sidenotes/formatter.rb
Constant Summary collapse
- HEADER_COMMENT =
"# Generated by Sidenotes v%<version>s on %<timestamp>s\n" \ "# Do not edit manually — regenerate with `rake sidenotes:generate`\n"
Instance Method Summary collapse
-
#initialize(model_name, data) ⇒ Formatter
constructor
A new instance of Formatter.
- #render ⇒ Object
Constructor Details
#initialize(model_name, data) ⇒ Formatter
Returns a new instance of Formatter.
11 12 13 14 |
# File 'lib/sidenotes/formatter.rb', line 11 def initialize(model_name, data) @model_name = model_name @data = data end |
Instance Method Details
#render ⇒ Object
16 17 18 19 20 21 |
# File 'lib/sidenotes/formatter.rb', line 16 def render case Sidenotes.configuration.format when :yaml then render_yaml when :json then render_json end end |