Sha256: c8021214a0c05528871801017a8fb030c0c54b5f47ff82ad08ff6defacc4fd3f

Contents?: true

Size: 886 Bytes

Versions: 2

Compression:

Stored size: 886 Bytes

Contents

# frozen_string_literal: true

module PuppeteerEntity
  module Attributes
    class Viewport < Dry::Struct
      transform_keys(&:to_sym)

      # The page width in CSS pixels.
      attribute :width, Types::Coercible::Integer
      # The page height in CSS pixels.
      attribute :height, Types::Coercible::Integer
      # Specify device scale factor. See {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio devicePixelRatio} for more info.
      attribute? :device_scale_factor, Types::Coercible::Float.optional
      # Whether the meta viewport tag is taken into account.
      attribute? :is_mobile, Types::Bool.optional
      # Specifies if the viewport is in landscape mode.
      attribute? :is_landscape, Types::Bool.optional
      # Specify if the viewport supports touch events.
      attribute? :has_touch, Types::Bool.optional
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppeteer_entity-0.1.1 lib/puppeteer_entity/attributes/viewport.rb
puppeteer_entity-0.1.0 lib/puppeteer_entity/attributes/viewport.rb