Class: Spirit::Render::Image
- Defined in:
- lib/spirit/render/templates/image.rb
Overview
Renders a block image with a figure number.
Constant Summary collapse
- IMAGE_TAG =
<img …>
'img'.freeze
Class Method Summary collapse
-
.parse(text) ⇒ Object
Parses the given text for a block image.
Instance Method Summary collapse
-
#initialize(html) ⇒ Image
constructor
Creates a new image.
- #render(locals = {}) ⇒ Object
Constructor Details
#initialize(html) ⇒ Image
Creates a new image.
21 22 23 24 |
# File 'lib/spirit/render/templates/image.rb', line 21 def initialize(html) @html = html parse_or_raise end |
Class Method Details
Instance Method Details
#render(locals = {}) ⇒ Object
26 27 28 |
# File 'lib/spirit/render/templates/image.rb', line 26 def render(locals={}) super locals.merge(img: @html, caption: @node['alt']) end |