Class: RRTF::FooterNode

Inherits:
CommandNode show all
Defined in:
lib/rrtf/node.rb

Overview

This class represents a document footer.

Constant Summary collapse

UNIVERSAL =

A definition for a header type.

:footer
LEFT_PAGE =

A definition for a header type.

:footerl
RIGHT_PAGE =

A definition for a header type.

:footerr
FIRST_PAGE =

A definition for a header type.

:footerf

Instance Attribute Summary collapse

Attributes inherited from CommandNode

#prefix, #split, #suffix, #wrap

Attributes inherited from ContainerNode

#children

Attributes inherited from Node

#parent

Instance Method Summary collapse

Methods inherited from CommandNode

#<<, #apply, #background, #bold, #colour, #font, #foreground, #image, #italic, #line_break, #link, #list, #paragraph, #strike, #subscript, #superscript, #table, #to_rtf, #underline

Methods inherited from ContainerNode

#[], #each, #first, #last, #size, #store, #to_rtf

Methods inherited from Node

#is_root?, #next_node, #previous_node, #root

Constructor Details

#initialize(document, type = UNIVERSAL) ⇒ FooterNode

This is the constructor for the FooterNode class.

Parameters

document

A reference to the Document object that will own the new footer.

type

The style type for the new footer. Defaults to a value of FooterNode::UNIVERSAL.



1234
1235
1236
1237
# File 'lib/rrtf/node.rb', line 1234

def initialize(document, type=UNIVERSAL)
   super(document, "\\#{type.id2name}", nil, false)
   @type = type
end

Instance Attribute Details

#typeObject

Attribute accessor.



1221
1222
1223
# File 'lib/rrtf/node.rb', line 1221

def type
  @type
end

Instance Method Details

#footnote(text) ⇒ Object

This method overloads the footnote method inherited from the CommandNode class to prevent footnotes being added to footers.

Parameters

text

Not used.

Exceptions

RTFError

Always generated whenever this method is called.



1247
1248
1249
# File 'lib/rrtf/node.rb', line 1247

def footnote(text)
   RTFError.fire("Footnotes are not permitted in page footers.")
end