Class: RRTF::PositionStyle

Inherits:
AnonymousStyle show all
Includes:
PositionFormatting
Defined in:
lib/rrtf/style/position_style.rb

Overview

Represents a set of formatting that can be applied to position paragraphs.

Constant Summary

Constants included from PositionFormatting

RRTF::PositionFormatting::POSITION_ATTRIBUTES

Instance Method Summary collapse

Methods included from PositionFormatting

included, #initialize_position_formatting, #position_formatting_to_rtf, #set_position_formatting_from_hashmap

Methods inherited from AnonymousStyle

#push_colours, #push_fonts, #suffix

Constructor Details

#initialize(options = {}) ⇒ PositionStyle

This is the constructor for the PositionStyle class.

Parameters:

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

    the position style options.

Options Hash (options):

  • "sides" (String) — default: 'ALL'

    the sides to which the border applied (“ALL”, “LEFT”, “RIGHT”, “TOP”, or “BOTTOM”).



11
12
13
14
# File 'lib/rrtf/style/position_style.rb', line 11

def initialize(options = {})
   super(options)
   initialize_position_formatting(options)
end

Instance Method Details

#prefix(document) ⇒ Object

This method generates a string containing the prefix associated with the style object. Equivalent to #rtf_formatting for the PositionStyle class.



18
19
20
# File 'lib/rrtf/style/position_style.rb', line 18

def prefix(document)
  rtf_formatting(document)
end

#rtf_formatting(document) ⇒ Object



22
23
24
# File 'lib/rrtf/style/position_style.rb', line 22

def rtf_formatting(document)
  position_formatting_to_rtf(document)
end