Class: DynamicPDFApi::DpiImageSize

Inherits:
ImageSize
  • Object
show all
Defined in:
lib/ruby_client/Imaging/DpiImageSize.rb

Overview

Represents an image size defined by DPI (Dots Per Inch).

Instance Attribute Summary collapse

Attributes inherited from ImageSize

#type

Instance Method Summary collapse

Constructor Details

#initializeDpiImageSize

Initializes a new instance of the DpiImageSize class and sets the image size type to DPI.



14
15
16
17
18
19
# File 'lib/ruby_client/Imaging/DpiImageSize.rb', line 14

def initialize
  super
  @horizontal_dpi = nil
  @vertical_dpi = nil
  @type = ImageSizeType::Dpi
end

Instance Attribute Details

#horizontal_dpiObject

Gets or sets the horizontal DPI (Dots Per Inch) of the image.



8
9
10
# File 'lib/ruby_client/Imaging/DpiImageSize.rb', line 8

def horizontal_dpi
  @horizontal_dpi
end

#vertical_dpiObject

Gets or sets the vertical DPI (Dots Per Inch) of the image.



9
10
11
# File 'lib/ruby_client/Imaging/DpiImageSize.rb', line 9

def vertical_dpi
  @vertical_dpi
end

Instance Method Details

#to_json(_options = {}) ⇒ String

Returns a JSON representation of the DpiImageSize object.

Returns:

  • (String)

    JSON string representing the DpiImageSize object.



26
27
28
29
30
31
32
33
34
# File 'lib/ruby_client/Imaging/DpiImageSize.rb', line 26

def to_json(_options = {})
  json_array = {}
  json_array['type'] = 'dpi'

  json_array['horizontalDpi'] = @horizontal_dpi
  json_array['verticalDpi'] = @vertical_dpi

  JSON.pretty_generate(json_array)
end