Class: RTF::Paper

Inherits:
Object
  • Object
show all
Defined in:
lib/rtf/paper.rb

Overview

This class represents a definition for a paper size and provides a set of class constants for common paper sizes. An instance of the Paper class is considered immutable after creation.

Constant Summary collapse

A0 =

Definition of an international paper constant.

Paper.new('A0', 47685, 67416)
A1 =

Definition of an international paper constant.

Paper.new('A1', 33680, 47685)
A2 =

Definition of an international paper constant.

Paper.new('A2', 23814, 33680)
A3 =

Definition of an international paper constant.

Paper.new('A3', 16840, 23814)
A4 =

Definition of an international paper constant.

Paper.new('A4', 11907, 16840)
A5 =

Definition of an international paper constant.

Paper.new('A5', 8392, 11907)
LETTER =

Definition of a US paper constant.

Paper.new('Letter', 12247, 15819)
Paper.new('Legal', 12247, 20185)
EXECUTIVE =

Definition of a US paper constant.

Paper.new('Executive', 10773, 14402)
LEDGER_TABLOID =

Definition of a US paper constant.

Paper.new('Ledger/Tabloid', 15819, 24494)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, width, height) ⇒ Paper

This is the constructor for the Paper class. All dimension parameters to this method are in twips.

Parameters

name

The name for the paper object.

width

The width of the paper in portrait mode.

height

The height of the paper in portrait mode.



19
20
21
22
23
# File 'lib/rtf/paper.rb', line 19

def initialize(name, width, height)
   @name   = name
   @width  = width
   @height = height
end

Instance Attribute Details

#heightObject (readonly)

Attribute accessor.



9
10
11
# File 'lib/rtf/paper.rb', line 9

def height
  @height
end

#nameObject (readonly)

Attribute accessor.



9
10
11
# File 'lib/rtf/paper.rb', line 9

def name
  @name
end

#widthObject (readonly)

Attribute accessor.



9
10
11
# File 'lib/rtf/paper.rb', line 9

def width
  @width
end