Class: Prune::Elements::Pages

Inherits:
Base
  • Object
show all
Defined in:
lib/prune/elements/pages.rb

Instance Attribute Summary

Attributes inherited from Base

#document

Instance Method Summary collapse

Methods inherited from Base

#reference, #register, #to_s

Methods included from Functions

#mm_to_pt, #pt_to_mm

Methods included from PObjects

pa, pd, ph, pl, pn, ps

Constructor Details

#initialize(document) ⇒ Pages

Initialize.



7
8
9
10
11
12
13
14
# File 'lib/prune/elements/pages.rb', line 7

def initialize(document)
  super(document)
  @content = pd(
    pn(:Type) => pn(:Pages),
    pn(:Kids) => pa,
    pn(:Count) => 0)
  register
end

Instance Method Details

#<<(page) ⇒ Object

Add page.



22
23
24
25
# File 'lib/prune/elements/pages.rb', line 22

def <<(page)
  @content[pn(:Kids)] << page.reference
  @content[pn(:Count)] += 1
end

#empty?Boolean

Determine emptyness of pages.

Returns:

  • (Boolean)


17
18
19
# File 'lib/prune/elements/pages.rb', line 17

def empty?
  @content[pn(:Kids)].empty?
end