Class: Pdfrb::Document::Destinations
- Inherits:
-
Object
- Object
- Pdfrb::Document::Destinations
- Defined in:
- lib/pdfrb/document/destinations.rb
Overview
Named-destinations facade (stub). Full implementation in TODO 129.
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(document) ⇒ Destinations
constructor
A new instance of Destinations.
Constructor Details
#initialize(document) ⇒ Destinations
Returns a new instance of Destinations.
9 10 11 |
# File 'lib/pdfrb/document/destinations.rb', line 9 def initialize(document) @document = document end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
7 8 9 |
# File 'lib/pdfrb/document/destinations.rb', line 7 def document @document end |
Instance Method Details
#[](name) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/pdfrb/document/destinations.rb', line 13 def [](name) names = document.catalog.value[:Names] return nil unless names.is_a?(::Hash) || names.is_a?(Pdfrb::Model::Cos::Dictionary) dests = names.is_a?(Pdfrb::Model::Cos::Dictionary) ? names.value[:Dests] : names[:Dests] dests ? dests[name] : nil end |