Class: Milestoner::Renderers::Universal
- Inherits:
-
Object
- Object
- Milestoner::Renderers::Universal
- Defined in:
- lib/milestoner/renderers/universal.rb
Overview
The primary renderer for multiple input formats as HTML.
Constant Summary collapse
- DELEGATES =
{asciidoc: Asciidoc.new, markdown: Markdown.new}.freeze
Instance Method Summary collapse
- #call(content, for: default_format) ⇒ Object
-
#initialize(delegates: DELEGATES) ⇒ Universal
constructor
A new instance of Universal.
Constructor Details
#initialize(delegates: DELEGATES) ⇒ Universal
Returns a new instance of Universal.
15 16 17 18 19 |
# File 'lib/milestoner/renderers/universal.rb', line 15 def initialize(delegates: DELEGATES, **) super(**) @delegates = delegates @default_format = settings.commit_format.to_sym end |
Instance Method Details
#call(content, for: default_format) ⇒ Object
21 |
# File 'lib/milestoner/renderers/universal.rb', line 21 def call(content, for: default_format) = delegates.fetch(binding[:for]).call content |