Class: PictureTag::Srcsets::PixelRatio

Inherits:
Object
  • Object
show all
Includes:
Basics
Defined in:
lib/jekyll-4-picture-tag/srcsets/pixel_ratio.rb

Overview

Creates a srcset in the “(filename) (pixel_ratio)x” format. Example: “img.jpg 1x, img2.jpg 1.5x, img3.jpg 2x”

Instance Attribute Summary

Attributes included from Basics

#media, #source_image

Instance Method Summary collapse

Methods included from Basics

#check_widths, #initialize, #media_attribute, #mime_type, #sizes, #to_s

Instance Method Details

#to_aObject



8
9
10
# File 'lib/jekyll-4-picture-tag/srcsets/pixel_ratio.rb', line 8

def to_a
  widths.collect { |w| build_srcset_entry(w) }
end