Class: TXTextControl::ReportingCloud::MergeBody
- Inherits:
-
Object
- Object
- TXTextControl::ReportingCloud::MergeBody
- Defined in:
- lib/txtextcontrol/reportingcloud/merge_body.rb
Overview
Passes data to the ReportingCloud#merge_document method.
Instance Attribute Summary collapse
-
#merge_data ⇒ Array<Hash>
The merge data.
-
#merge_settings ⇒ MergeSettings
Merge settings to specify merge properties and document properties such as title and author.
-
#template ⇒ String
Base64 encoded template document.
Instance Method Summary collapse
-
#initialize(merge_data, merge_settings = nil, template = nil) ⇒ MergeBody
constructor
The constructor.
-
#to_camelized_hash ⇒ Hash
Converts a MergeBody instance to a hash while converting the attribute names from snake case to camel case.
Constructor Details
#initialize(merge_data, merge_settings = nil, template = nil) ⇒ MergeBody
The constructor.
38 39 40 41 42 |
# File 'lib/txtextcontrol/reportingcloud/merge_body.rb', line 38 def initialize(merge_data, merge_settings = nil, template = nil) self.merge_data = merge_data @template = template @merge_settings = merge_settings end |
Instance Attribute Details
#merge_data ⇒ Array<Hash>
The merge data. Must be an array of hashes.
27 28 29 |
# File 'lib/txtextcontrol/reportingcloud/merge_body.rb', line 27 def merge_data @merge_data end |
#merge_settings ⇒ MergeSettings
Merge settings to specify merge properties and document properties such as title and author.
27 28 29 |
# File 'lib/txtextcontrol/reportingcloud/merge_body.rb', line 27 def merge_settings @merge_settings end |
#template ⇒ String
Base64 encoded template document. Supported formats are RTF, DOC, DOCX and TX.
27 28 29 |
# File 'lib/txtextcontrol/reportingcloud/merge_body.rb', line 27 def template @template end |
Instance Method Details
#to_camelized_hash ⇒ Hash
Converts a MergeBody instance to a hash while converting the attribute names from snake case to camel case.
58 59 60 61 62 63 64 |
# File 'lib/txtextcontrol/reportingcloud/merge_body.rb', line 58 def to_camelized_hash return { "mergeData" => @merge_data, "template" => @template, "mergeSettings" => @merge_settings.nil? ? nil : @merge_settings.to_camelized_hash } end |