Class: DynamicPDFApi::MaxImageSize

Inherits:
ImageSize
  • Object
show all
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

Attributes inherited from ImageSize

#type

Instance Method Summary collapse

Constructor Details

#initializeMaxImageSize

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_heightObject

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_widthObject

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

#unitObject

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.

Returns:

  • (String)

    JSON string representing the MaxImageSize object.



29
30
31
32
33
34
35
36
# File 'lib/ruby_client/Imaging/MaxImageSize.rb', line 29

def to_json(_options = {})
  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