Class: Prune::Elements::Pages
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#<<(page) ⇒ Object
Add page.
-
#empty? ⇒ Boolean
Determine emptyness of pages.
-
#initialize(document) ⇒ Pages
constructor
Initialize.
Methods inherited from Base
Methods included from Functions
Methods included from PObjects
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.
17 18 19 |
# File 'lib/prune/elements/pages.rb', line 17 def empty? @content[pn(:Kids)].empty? end |