Module: PhotoCook::DevicePixelRatioSpy

Extended by:
ActiveSupport::Concern
Defined in:
lib/photo-cook/device-pixel-ratio-spy.rb

Instance Method Summary collapse

Instance Method Details

#pass_device_pixel_ratioObject



10
11
12
13
14
15
16
17
# File 'lib/photo-cook/device-pixel-ratio-spy.rb', line 10

def pass_device_pixel_ratio
  ratio = PhotoCook::DevicePixelRatio.parse(cookies[:DevicePixelRatio])
  PhotoCook.device_pixel_ratio = if PhotoCook::DevicePixelRatio.valid?(ratio)
    ratio
  else
    PhotoCook::DevicePixelRatio::DEFAULT
  end
end