Class: DynamicPDFApi::PercentageImageSize

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

Overview

Represents an image size based on percentage scaling.

Instance Attribute Summary collapse

Attributes inherited from ImageSize

#type

Instance Method Summary collapse

Constructor Details

#initializePercentageImageSize

Initializes a new instance of the PercentageImageSize class.



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

def initialize
  super()
  @horizontal_percentage = nil
  @vertical_percentage = nil
  @type = ImageSizeType::Percentage
end

Instance Attribute Details

#horizontal_percentageObject

Gets or sets the horizontal scaling percentage.



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

def horizontal_percentage
  @horizontal_percentage
end

#vertical_percentageObject

Gets or sets the vertical scaling percentage.



10
11
12
# File 'lib/ruby_client/Imaging/PercentageImageSize.rb', line 10

def vertical_percentage
  @vertical_percentage
end

Instance Method Details

#to_json(_options = {}) ⇒ String

Returns a JSON representation of the PercentageImageSize object.

Returns:

  • (String)

    JSON string representing the PercentageImageSize object.



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

def to_json(_options = {})
  json_array = {}
  json_array['type'] = 'percentage'
  json_array['horizontalPercentage'] = @horizontal_percentage
  json_array['verticalPercentage'] = @vertical_percentage
  JSON.pretty_generate(json_array)
end