class TXTextControl::ReportingCloud::FindAndReplaceBody
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. @attr find_and_replace_data
[Array<Array<String>>] The find and replace
pair values as an array of string arrays.
@attr merge_settings
[MergeSettings] Merge settings to specify merge
properties and document properties such as title and author.
@attr template [String] The source document encoded as a Base64 string.
Attributes
Public Class Methods
@param find_and_replace_data
[Array<Array<String>>] The find and replace
pair values as an array of string arrays.
@param template [String] The source document encoded as a Base64 string.
The supported document formats are +.rtf+, +.doc+, +.docx+, and +.tx+.
@param merge_settings
[MergeSettings] Merge settings to specify merge
properties and document properties such as title and author.
# 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
Public Instance Methods
# File lib/txtextcontrol/reportingcloud/find_and_replace_body.rb, line 48 def find_and_replace_data=(val) unless !val.nil? && (val.kind_of? Array) && !val.empty? && (val.all? { |elem| elem.kind_of? Array }) && (val.all? { |elem| (elem.length == 2) && (elem[0].kind_of? String) && (elem[1].kind_of? String) }) raise ArgumentError, "Find and replace data must be a non empty array of string arrays containing two strings each." end @find_and_replace_data = val end
# File lib/txtextcontrol/reportingcloud/find_and_replace_body.rb, line 60 def merge_settings=(val) unless val.nil? || (val.kind_of? MergeSettings) raise ArgumentError, "Merge settings must be of type MergeSettings." end @merge_settings = val end
# File lib/txtextcontrol/reportingcloud/find_and_replace_body.rb, line 71 def template=(val) unless val.nil? || ((val.kind_of? String) && !val.to_s.empty?) raise ArgumentError, "Template data must be a non empty string." end @template = val end
Converts a FindAndReplaceBody
instance to a hash while converting the attribute names from snake case to camel case. @return [Hash] A hash representing the FindAndReplaceBody
instance.
# 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