Class: TXTextControl::ReportingCloud::AppendDocument
- Inherits:
-
Object
- Object
- TXTextControl::ReportingCloud::AppendDocument
- Defined in:
- lib/txtextcontrol/reportingcloud/append_document.rb
Overview
Passes data to the ReportingCloud#append_documents method.
Instance Attribute Summary collapse
-
#document ⇒ String
The document as a Base64 encoded string.
-
#document_divider ⇒ Symbol
The document divider option.
Instance Method Summary collapse
-
#initialize(document, document_divider = :none) ⇒ AppendDocument
constructor
A new instance of AppendDocument.
-
#to_camelized_hash ⇒ Hash
Converts an AppendBody instance to a hash while converting the attribute names from snake case to camel case.
Constructor Details
#initialize(document, document_divider = :none) ⇒ AppendDocument
Returns a new instance of AppendDocument
25 26 27 28 |
# File 'lib/txtextcontrol/reportingcloud/append_document.rb', line 25 def initialize(document, document_divider = :none) self.document = document @document_divider = document_divider end |
Instance Attribute Details
#document ⇒ String
The document as a Base64 encoded string.
22 23 24 |
# File 'lib/txtextcontrol/reportingcloud/append_document.rb', line 22 def document @document end |
#document_divider ⇒ Symbol
The document divider option. Possible values are :none
,
:new_paragraph
and :new_section
.
22 23 24 |
# File 'lib/txtextcontrol/reportingcloud/append_document.rb', line 22 def document_divider @document_divider end |
Instance Method Details
#to_camelized_hash ⇒ Hash
Converts an AppendBody instance to a hash while converting the attribute names from snake case to camel case.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/txtextcontrol/reportingcloud/append_document.rb', line 44 def to_camelized_hash result = { "document" => @document, "documentDivider" => "None" } case @document_divider when :new_paragraph result["documentDivider"] = "NewParagraph" when :new_section result["documentDivider"] = "NewSection" end return result end |