Class: DynamicPDFApi::DpiImageSize
- Defined in:
- lib/ruby_client/Imaging/DpiImageSize.rb
Overview
Represents an image size defined by DPI (Dots Per Inch).
Instance Attribute Summary collapse
-
#horizontal_dpi ⇒ Object
Gets or sets the horizontal DPI (Dots Per Inch) of the image.
-
#vertical_dpi ⇒ Object
Gets or sets the vertical DPI (Dots Per Inch) of the image.
Attributes inherited from ImageSize
Instance Method Summary collapse
-
#initialize ⇒ DpiImageSize
constructor
Initializes a new instance of the DpiImageSize class and sets the image size type to DPI.
-
#to_json(_options = {}) ⇒ String
Returns a JSON representation of the DpiImageSize object.
Constructor Details
#initialize ⇒ DpiImageSize
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_dpi ⇒ Object
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_dpi ⇒ Object
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.
26 27 28 29 30 31 32 33 34 |
# File 'lib/ruby_client/Imaging/DpiImageSize.rb', line 26 def to_json( = {}) json_array = {} json_array['type'] = 'dpi' json_array['horizontalDpi'] = @horizontal_dpi json_array['verticalDpi'] = @vertical_dpi JSON.pretty_generate(json_array) end |