Class: TXTextControl::ReportingCloud::FindAndReplaceBody

Inherits:
Object
  • Object
show all
Defined in:
lib/txtextcontrol/reportingcloud/find_and_replace_body.rb

Overview

The request body of requests to the endpoint “/document/findandreplace”. Contains an array of string arrays, a template encoded as a Base64 string and a ReportingCloud MergeSettings object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(find_and_replace_data, template = nil, merge_settings = nil) ⇒ FindAndReplaceBody

Returns a new instance of FindAndReplaceBody

Parameters:

  • find_and_replace_data (Array<Array<String>>)

    The find and replace pair values as an array of string arrays.

  • template (String) (defaults to: nil)

    The source document encoded as a Base64 string. The supported document formats are .rtf, .doc, .docx, and .tx.

  • merge_settings (MergeSettings) (defaults to: nil)

    Merge settings to specify merge properties and document properties such as title and author.



38
39
40
41
42
# File 'lib/txtextcontrol/reportingcloud/find_and_replace_body.rb', line 38

def initialize(find_and_replace_data, template = nil, merge_settings = nil)
  self.find_and_replace_data = find_and_replace_data
  self.template = template
  self.merge_settings = merge_settings
end

Instance Attribute Details

#find_and_replace_dataArray<Array<String>>

The find and replace pair values as an array of string arrays.

Returns:

  • (Array<Array<String>>)

    the current value of find_and_replace_data



27
28
29
# File 'lib/txtextcontrol/reportingcloud/find_and_replace_body.rb', line 27

def find_and_replace_data
  @find_and_replace_data
end

#merge_settingsMergeSettings

Merge settings to specify merge properties and document properties such as title and author.

Returns:



27
28
29
# File 'lib/txtextcontrol/reportingcloud/find_and_replace_body.rb', line 27

def merge_settings
  @merge_settings
end

#templateString

The source document encoded as a Base64 string.

Returns:

  • (String)

    the current value of template



27
28
29
# File 'lib/txtextcontrol/reportingcloud/find_and_replace_body.rb', line 27

def template
  @template
end

Instance Method Details

#to_camelized_hashHash

Converts a FindAndReplaceBody instance to a hash while converting the attribute names from snake case to camel case.

Returns:

  • (Hash)

    A hash representing the FindAndReplaceBody instance.



81
82
83
84
85
86
87
# File 'lib/txtextcontrol/reportingcloud/find_and_replace_body.rb', line 81

def to_camelized_hash
  return {
    "findAndReplaceData" => @find_and_replace_data,
    "template" => @template,
    "mergeSettings" => @merge_settings
  }
end