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.


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

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

Instance Attribute Details

#heightFixnum

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

Returns:

  • (Fixnum)

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

def height
  @height
end

#leftFixnum

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

Returns:

  • (Fixnum)

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

def left
  @left
end

#topFixnum

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

Returns:

  • (Fixnum)

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

def top
  @top
end

#widthFixnum

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

Returns:

  • (Fixnum)

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

def width
  @width
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


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

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