Class: TXTextControl::ReportingCloud::MergeSettings

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

Overview

Holds the merge settings needed by the merge method.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMergeSettings

Returns a new instance of MergeSettings.



45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 45

def initialize
  @remove_empty_fields = true
  @remove_empty_blocks = true
  @remove_empty_images = true
  @remove_trailing_whitespace = true
  
  @author = nil
  @creation_date = nil
  @creator_application = nil
  @document_subject = nil
  @document_title = nil
  @last_modification_date = nil
  @user_password = nil
end

Instance Attribute Details

#authorString

The document’s author.

Returns:

  • (String)

    the current value of author



34
35
36
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 34

def author
  @author
end

#creation_dateDateTime

The document’s creation date.

Returns:

  • (DateTime)

    the current value of creation_date



34
35
36
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 34

def creation_date
  @creation_date
end

#creator_applicationString

The application which created the document.

Returns:

  • (String)

    the current value of creator_application



34
35
36
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 34

def creator_application
  @creator_application
end

#document_subjectString

The document’s subject.

Returns:

  • (String)

    the current value of document_subject



34
35
36
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 34

def document_subject
  @document_subject
end

#document_titleString

The document’s title.

Returns:

  • (String)

    the current value of document_title



34
35
36
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 34

def document_title
  @document_title
end

#last_modification_dateDateTime

The document’s last modification date.

Returns:

  • (DateTime)

    the current value of last_modification_date



34
35
36
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 34

def last_modification_date
  @last_modification_date
end

#remove_empty_blocksBoolean

Specifies whether the content of empty merge blocks should be removed from the template or not.

Returns:

  • (Boolean)

    the current value of remove_empty_blocks



34
35
36
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 34

def remove_empty_blocks
  @remove_empty_blocks
end

#remove_empty_fieldsBoolean

Specifies whether empty fields should be removed from the template or not.

Returns:

  • (Boolean)

    the current value of remove_empty_fields



34
35
36
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 34

def remove_empty_fields
  @remove_empty_fields
end

#remove_empty_imagesBoolean

Specifies whether images which don’t have merge data should be removed from the template or not.

Returns:

  • (Boolean)

    the current value of remove_empty_images



34
35
36
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 34

def remove_empty_images
  @remove_empty_images
end

#remove_trailing_whitespaceBoolean

Specifies whether trailing whitespace should be removed before saving a document.

Returns:

  • (Boolean)

    the current value of remove_trailing_whitespace



34
35
36
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 34

def remove_trailing_whitespace
  @remove_trailing_whitespace
end

#user_passwordString

The password needed to open the document.

Returns:

  • (String)

    the current value of user_password



34
35
36
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 34

def user_password
  @user_password
end

Instance Method Details

#to_camelized_hashHash

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

Returns:

  • (Hash)

    A hash representing the MergeSettings instance.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/txtextcontrol/reportingcloud/merge_settings.rb', line 95

def to_camelized_hash
  return {
    "removeEmptyFields" => @remove_empty_fields,
    "removeEmptyBlocks" => @remove_empty_blocks,
    "removeEmptyImages" => @remove_empty_images,
    "removeTrailingWhitespace" => @remove_trailing_whitespace,
    "author" => @author,
    "creationDate" => @creation_date.nil? ? nil : @creation_date.iso8601,
    "creatorApplication" => @creator_application,
    "documentSubject" => @document_subject,
    "documentTitle" => @document_title,
    "lastModificationDate" => @last_modification_date.nil? ? nil : @last_modification_date.iso8601,
    "userPassword" => @user_password
  }
end