Class: DynamicPDFApi::MaxImageSize
- Defined in:
- lib/ruby_client/Imaging/MaxImageSize.rb
Overview
Represents an image size that fits within a specified maximum width and height.
Instance Attribute Summary collapse
-
#max_height ⇒ Object
Gets or sets the maximum height of the image.
-
#max_width ⇒ Object
Gets or sets the maximum width of the image.
-
#unit ⇒ Object
Gets or sets the unit of measurement for the maximum width and height.
Attributes inherited from ImageSize
Instance Method Summary collapse
-
#initialize ⇒ MaxImageSize
constructor
Initializes a new instance of the MaxImageSize class.
-
#to_json(_options = {}) ⇒ String
Returns a JSON representation of the MaxImageSize object.
Constructor Details
#initialize ⇒ MaxImageSize
Initializes a new instance of the MaxImageSize class.
16 17 18 19 20 21 22 |
# File 'lib/ruby_client/Imaging/MaxImageSize.rb', line 16 def initialize super() @max_width = nil @max_height = nil @unit = nil @type = ImageSizeType::Max end |
Instance Attribute Details
#max_height ⇒ Object
Gets or sets the maximum height of the image.
10 11 12 |
# File 'lib/ruby_client/Imaging/MaxImageSize.rb', line 10 def max_height @max_height end |
#max_width ⇒ Object
Gets or sets the maximum width of the image.
9 10 11 |
# File 'lib/ruby_client/Imaging/MaxImageSize.rb', line 9 def max_width @max_width end |
#unit ⇒ Object
Gets or sets the unit of measurement for the maximum width and height.
11 12 13 |
# File 'lib/ruby_client/Imaging/MaxImageSize.rb', line 11 def unit @unit end |
Instance Method Details
#to_json(_options = {}) ⇒ String
Returns a JSON representation of the MaxImageSize object.
29 30 31 32 33 34 35 36 |
# File 'lib/ruby_client/Imaging/MaxImageSize.rb', line 29 def to_json( = {}) json_array = {} json_array['type'] = 'max' json_array['maxWidth'] = @max_width json_array['maxHeight'] = @max_height json_array['unit'] = @unit JSON.pretty_generate(json_array) end |