Sha256: 11aa219fb80dc31a51b3f12cbcbd77af543e4c8da51f07af8e33bddda9d6f50c
Contents?: true
Size: 593 Bytes
Versions: 51
Compression:
Stored size: 593 Bytes
Contents
class Puppeteer::ElementHandle < Puppeteer::JSHandle class BoxModel QUAD_ATTRIBUTE_NAMES = %i(content padding border margin) # @param result [Hash] def initialize(result_model) QUAD_ATTRIBUTE_NAMES.each do |attr_name| quad = result_model[attr_name.to_s] instance_variable_set( :"@#{attr_name}", quad.each_slice(2).map { |x, y| Point.new(x: x, y: y) }, ) end @width = result_model['width'] @height = result_model['height'] end attr_reader(*QUAD_ATTRIBUTE_NAMES) attr_reader :width, :height end end
Version data entries
51 entries across 51 versions & 1 rubygems