Class: Google::Apis::PagespeedonlineV2::Image::PageRect

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/pagespeedonline_v2/classes.rb,
generated/google/apis/pagespeedonline_v2/representations.rb,
generated/google/apis/pagespeedonline_v2/representations.rb

Overview

The region of the page that is captured by this image, with dimensions measured in CSS pixels.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ PageRect

Returns a new instance of PageRect



250
251
252
# File 'generated/google/apis/pagespeedonline_v2/classes.rb', line 250

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#heightFixnum

The height of the rect. Corresponds to the JSON property height

Returns:

  • (Fixnum)


233
234
235
# File 'generated/google/apis/pagespeedonline_v2/classes.rb', line 233

def height
  @height
end

#leftFixnum

The left coordinate of the rect, in page coordinates. Corresponds to the JSON property left

Returns:

  • (Fixnum)


238
239
240
# File 'generated/google/apis/pagespeedonline_v2/classes.rb', line 238

def left
  @left
end

#topFixnum

The top coordinate of the rect, in page coordinates. Corresponds to the JSON property top

Returns:

  • (Fixnum)


243
244
245
# File 'generated/google/apis/pagespeedonline_v2/classes.rb', line 243

def top
  @top
end

#widthFixnum

The width of the rect. Corresponds to the JSON property width

Returns:

  • (Fixnum)


248
249
250
# File 'generated/google/apis/pagespeedonline_v2/classes.rb', line 248

def width
  @width
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



255
256
257
258
259
260
# File 'generated/google/apis/pagespeedonline_v2/classes.rb', line 255

def update!(**args)
  @height = args[:height] if args.key?(:height)
  @left = args[:left] if args.key?(:left)
  @top = args[:top] if args.key?(:top)
  @width = args[:width] if args.key?(:width)
end