Class: RRTF::DocumentProperties

Inherits:
Properties show all
Includes:
DocumentFormatting, PageFormatting
Defined in:
lib/rrtf/properties/document_properties.rb

Overview

This class represents properties that are to be applied at the document level.

Author:

  • Wesley Hileman

Since:

  • 1.0.0

Constant Summary

Constants included from PageFormatting

PageFormatting::PAGE_ATTRIBUTES, PageFormatting::PAGE_FORMATTING_TARGET_DICTIONARY

Constants included from DocumentFormatting

RRTF::DocumentFormatting::DOCUMENT_ATTRIBUTES

Instance Attribute Summary

Attributes included from PageFormatting

#target

Instance Method Summary collapse

Methods included from PageFormatting

included, #initialize_page_formatting, #page_formatting_to_rtf, #set_page_formatting_from_hashmap

Methods included from DocumentFormatting

#document_formatting_to_rtf, included, #initialize_document_formatting, #set_document_formatting_from_hashmap

Constructor Details

#initialize(options = {}) ⇒ DocumentProperties

This is a constructor for the DocumentProperties class.

Parameters:

  • options (Hash) (defaults to: {})

Since:

  • 1.0.0



17
18
19
20
# File 'lib/rrtf/properties/document_properties.rb', line 17

def initialize(options = {})
  initialize_document_formatting(options)
  initialize_page_formatting(options)
end

Instance Method Details

#to_rtfString

Converts a document properties object into an RTF sequence.

Returns:

  • (String)

    the RTF sequence corresponding to the properties object.

Since:

  • 1.0.0



25
26
27
28
29
30
31
32
# File 'lib/rrtf/properties/document_properties.rb', line 25

def to_rtf
  rtf = StringIO.new

  rtf << document_formatting_to_rtf
  rtf << page_formatting_to_rtf

  rtf.string
end