Class: DynamicPDFApi::FixedImageSize
- Defined in:
- lib/ruby_client/Imaging/FixedImageSize.rb
Overview
Represents an image size with fixed dimensions.
Instance Attribute Summary collapse
-
#height ⇒ Object
Gets or sets the height of the image.
-
#unit ⇒ Object
Gets or sets the unit of measurement ImageSizeUnit for the width and height.
-
#width ⇒ Object
Gets or sets the width of the image.
Attributes inherited from ImageSize
Instance Method Summary collapse
-
#initialize ⇒ FixedImageSize
constructor
Initializes a new instance of the FixedImageSize class and sets the image size type to Fixed.
-
#to_json(_options = {}) ⇒ String
Returns a JSON representation of the FixedImageSize object.
Constructor Details
#initialize ⇒ FixedImageSize
Initializes a new instance of the FixedImageSize class and sets the image size type to Fixed.
17 18 19 20 21 22 23 |
# File 'lib/ruby_client/Imaging/FixedImageSize.rb', line 17 def initialize super() @type = ImageSizeType::Fixed @width = nil @height = nil @unit = nil end |
Instance Attribute Details
#height ⇒ Object
Gets or sets the height of the image.
11 12 13 |
# File 'lib/ruby_client/Imaging/FixedImageSize.rb', line 11 def height @height end |
#unit ⇒ Object
Gets or sets the unit of measurement ImageSizeUnit for the width and height.
12 13 14 |
# File 'lib/ruby_client/Imaging/FixedImageSize.rb', line 12 def unit @unit end |
#width ⇒ Object
Gets or sets the width of the image.
10 11 12 |
# File 'lib/ruby_client/Imaging/FixedImageSize.rb', line 10 def width @width end |
Instance Method Details
#to_json(_options = {}) ⇒ String
Returns a JSON representation of the FixedImageSize object.
30 31 32 33 34 35 36 37 |
# File 'lib/ruby_client/Imaging/FixedImageSize.rb', line 30 def to_json( = {}) json_array = {} json_array['type'] = 'fixed' json_array['width'] = @width json_array['height'] = @height json_array['unit'] = @unit JSON.pretty_generate(json_array) end |