Class: Prune::Parsers::PageParser
- Defined in:
- lib/prune/parsers/document/page_parser.rb
Overview
Parser for directive “page”.
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
-
#initialize(document, size, options = {}) ⇒ PageParser
constructor
Initialize.
Methods included from Prune::PObjects
Methods included from Functions
Constructor Details
#initialize(document, size, options = {}) ⇒ PageParser
Initialize.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/prune/parsers/document/page_parser.rb', line 10 def initialize(document, size, = {}) @document = document # Check document size. raise DocumenteSizeError unless DOCUMENT_SIZES.has_key?(size) document_size = DOCUMENT_SIZES[size] # Create a new page. width, height = document_size.collect{|mm| mm_to_pt(mm)} @page = Page.new(@document, [0.0, 0.0, width, height], ) # Add page to pages. @document.pages << @page end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
7 8 9 |
# File 'lib/prune/parsers/document/page_parser.rb', line 7 def page @page end |