Class: DynamicPDFApi::PercentageImageSize
- Defined in:
- lib/ruby_client/Imaging/PercentageImageSize.rb
Overview
Represents an image size based on percentage scaling.
Instance Attribute Summary collapse
-
#horizontal_percentage ⇒ Object
Gets or sets the horizontal scaling percentage.
-
#vertical_percentage ⇒ Object
Gets or sets the vertical scaling percentage.
Attributes inherited from ImageSize
Instance Method Summary collapse
-
#initialize ⇒ PercentageImageSize
constructor
Initializes a new instance of the PercentageImageSize class.
-
#to_json(_options = {}) ⇒ String
Returns a JSON representation of the PercentageImageSize object.
Constructor Details
#initialize ⇒ PercentageImageSize
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_percentage ⇒ Object
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_percentage ⇒ Object
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.
27 28 29 30 31 32 33 |
# File 'lib/ruby_client/Imaging/PercentageImageSize.rb', line 27 def to_json( = {}) json_array = {} json_array['type'] = 'percentage' json_array['horizontalPercentage'] = @horizontal_percentage json_array['verticalPercentage'] = @vertical_percentage JSON.pretty_generate(json_array) end |