Method: PDF::Core::NameTree::Node#to_hash

Defined in:
lib/pdf/core/name_tree.rb

#to_hashHash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a hash representation of this node.

Returns:

  • a hash representation of this node

API:

  • private



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/pdf/core/name_tree.rb', line 75

def to_hash
  hash = {}

  hash[:Limits] = [least, greatest] if parent
  if leaf?
    hash[:Names] = children if leaf?
  else
    hash[:Kids] = children.map(&:ref)
  end

  hash
end