Class: DynamicPDFApi::TextReplace

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, replaceText, matchCase = false) ⇒ TextReplace

Represents the find and replace values and its options.

Parameters:

  • name= ("text")

    Text to find.

  • name= ("replaceText")

    Text to replace.

  • name= ("matchCase")

    True value will make the search operation case sensitive.



10
11
12
13
14
# File 'lib/ruby_client/TextReplace.rb', line 10

def initialize(text, replaceText, matchCase = false)
  @text = text
  @replace_text = replaceText
  @match_case = matchCase
end

Instance Attribute Details

#match_caseObject

If True, the search operation will be case sensitive.



29
30
31
# File 'lib/ruby_client/TextReplace.rb', line 29

def match_case
  @match_case
end

#replace_textObject

Gets or sets ReplaceText value.This string will replace the Text during conversion.



24
25
26
# File 'lib/ruby_client/TextReplace.rb', line 24

def replace_text
  @replace_text
end

#textObject

Gets or sets the Find Text value. This string will be replaced with ReplaceText during conversion.



19
20
21
# File 'lib/ruby_client/TextReplace.rb', line 19

def text
  @text
end

Instance Method Details

#to_json(_options = {}) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/ruby_client/TextReplace.rb', line 31

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

  json_array["text"] = @text

  json_array["replaceText"] = @replace_text unless @replace_text.nil?

  json_array["matchCase"] = @match_case unless @match_case.nil?

  JSON.pretty_generate(json_array)
end