Class: TXTextControl::ReportingCloud::AppendBody

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

Overview

Passes data to the ReportingCloud#append_documents method.

Author:

  • Thorsten Kummerow (@thomerow)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(documents, document_settings = nil) ⇒ AppendBody

Returns a new instance of AppendBody



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

def initialize(documents, document_settings = nil)
  self.documents = documents
  self.document_settings = document_settings
end

Instance Attribute Details

#document_settingsDocumentSettings

Optional. Document settings to specify document properties such as title and author.

Returns:



25
26
27
# File 'lib/txtextcontrol/reportingcloud/append_body.rb', line 25

def document_settings
  @document_settings
end

#documentsArray<AppendDocument>

The documents that are appended.

Returns:



25
26
27
# File 'lib/txtextcontrol/reportingcloud/append_body.rb', line 25

def documents
  @documents
end

Instance Method Details

#to_camelized_hashHash

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

Returns:

  • (Hash)

    A hash representing the AppendBody instance.



62
63
64
65
66
67
# File 'lib/txtextcontrol/reportingcloud/append_body.rb', line 62

def to_camelized_hash
  return {
    "documents" => @documents.map { |d| d.to_camelized_hash },
    "documentSettings" => @document_settings.nil? ? nil : @document_settings.to_camelized_hash
  }
end