Class: DynamicPDFApi::UrlAction

Inherits:
Action
  • Object
show all
Defined in:
lib/ruby_client/UrlAction.rb

Overview

Represents an action linking to an external URL.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ UrlAction

Initializes a new instance of the UrlAction class.

Parameters:

  • url (String)

    URL the action launches.



13
14
15
16
# File 'lib/ruby_client/UrlAction.rb', line 13

def initialize(url)
  super()
  @url = url
end

Instance Attribute Details

#urlObject

Gets or sets the URL launched by the action.



21
22
23
# File 'lib/ruby_client/UrlAction.rb', line 21

def url
  @url
end

Instance Method Details

#to_json(_options = {}) ⇒ Object



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

def to_json(_options = {})
  json_array = {}

  json_array['url'] = @url unless @url.nil?

  JSON.pretty_generate(json_array)
end