Class: DynamicPDFApi::ImageFormat

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

Overview

Base class for image formats.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ ImageFormat

Initializes a new instance of ImageFormat with the specified type.

Parameters:

  • type (Symbol)

    The type of the image format.



16
17
18
# File 'lib/ruby_client/Imaging/ImageFormat.rb', line 16

def initialize(type)
  @type = type
end

Instance Attribute Details

#typeObject (readonly)

Gets the image format type.



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

def type
  @type
end

Instance Method Details

#to_json(_options = {}) ⇒ String

Returns a JSON representation of the ImageFormat object.

Returns:

  • (String)

    JSON string representing the ImageFormat object.



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

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