Class: DynamicPDFApi::JpegImageFormat

Inherits:
ImageFormat show all
Defined in:
lib/ruby_client/Imaging/JpegImageFormat.rb

Overview

Represents JPEG image format with quality.

Instance Attribute Summary collapse

Attributes inherited from ImageFormat

#type

Instance Method Summary collapse

Constructor Details

#initializeJpegImageFormat

Initializes a new instance of the JpegImageFormat class.



14
15
16
17
# File 'lib/ruby_client/Imaging/JpegImageFormat.rb', line 14

def initialize
  super(ImageFormatType::JPEG)
  @quality = nil
end

Instance Attribute Details

#qualityObject

Gets or sets the quality of the JPEG image.



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

def quality
  @quality
end

Instance Method Details

#to_json(_options = {}) ⇒ String

Returns a JSON representation of the JpegImageFormat object.

Returns:

  • (String)

    JSON string representing the JpegImageFormat object.



24
25
26
27
28
29
# File 'lib/ruby_client/Imaging/JpegImageFormat.rb', line 24

def to_json(_options = {})
  json_array = {}
  json_array['type'] = 'jpeg'
  json_array['quality'] = @quality
  JSON.pretty_generate(json_array)
end