Class: Pdfrb::Model::Type::Outline

Inherits:
Cos::Dictionary show all
Defined in:
lib/pdfrb/model/type/outline.rb

Overview

Outline (bookmark) root (s12.3.3). Linked from Catalog /Outlines.

Instance Attribute Summary

Attributes inherited from Object

#document, #gen, #oid, #value

Instance Method Summary collapse

Methods inherited from Cos::Dictionary

#[], #[]=, arlington_available?, arlington_default, arlington_key_to_symbol, arlington_loaded_for?, arlington_mark_loaded, arlington_object, arlington_one_type_to_ruby, arlington_required?, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, field, #initialize, #key?, #keys, lookup_type, own_fields, #pdf_type, register_type, type_map, #validate

Methods inherited from Object

#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type

Constructor Details

This class inherits a constructor from Pdfrb::Model::Cos::Dictionary

Instance Method Details

#countObject



14
# File 'lib/pdfrb/model/type/outline.rb', line 14

def count; self[:Count]; end

#each_item(&block) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/pdfrb/model/type/outline.rb', line 38

def each_item(&block)
  return enum_for(:each_item) unless block
  return unless first && document

  cur_ref = first
  while cur_ref
    item = document.object(cur_ref)
    break unless item

    yield item
    cur_ref = item[:Next]
  end
end

#empty?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/pdfrb/model/type/outline.rb', line 16

def empty?
  !first
end

#firstObject



12
# File 'lib/pdfrb/model/type/outline.rb', line 12

def first; self[:First]; end

#has_items?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/pdfrb/model/type/outline.rb', line 20

def has_items?
  !!first
end

#lastObject



13
# File 'lib/pdfrb/model/type/outline.rb', line 13

def last; self[:Last]; end

#resolved_firstObject



24
25
26
27
28
29
# File 'lib/pdfrb/model/type/outline.rb', line 24

def resolved_first
  ref = first
  return nil unless ref && document

  document.object(ref)
end

#resolved_lastObject



31
32
33
34
35
36
# File 'lib/pdfrb/model/type/outline.rb', line 31

def resolved_last
  ref = last
  return nil unless ref && document

  document.object(ref)
end

#typeObject



11
# File 'lib/pdfrb/model/type/outline.rb', line 11

def type; self[:Type]; end