Class: PictureTag::OutputFormats::Basic
- Inherits:
-
Object
- Object
- PictureTag::OutputFormats::Basic
- Includes:
- ObjectiveElements
- Defined in:
- lib/jekyll_picture_tag/output_formats/basic.rb
Overview
Generic functions common to all output formats.
Direct Known Subclasses
Instance Method Summary collapse
-
#build_base_img ⇒ Object
Used for both the fallback image, and for the complete markup.
- #to_s ⇒ Object
Instance Method Details
#build_base_img ⇒ Object
Used for both the fallback image, and for the complete markup.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/jekyll_picture_tag/output_formats/basic.rb', line 14 def build_base_img img = SingleTag.new 'img' attributes = PictureTag.html_attributes img.attributes << attributes['img'] img.attributes << attributes['implicit'] fallback = build_fallback_image add_src(img, fallback.uri) add_alt(img, attributes['alt']) img end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/jekyll_picture_tag/output_formats/basic.rb', line 9 def to_s wrap(base_markup).to_s end |