Sha256: ded2aca2815fa8d3d7766c59131ff270fc4b3948edb957e7ffa00cd80a8c923c
Contents?: true
Size: 713 Bytes
Versions: 10
Compression:
Stored size: 713 Bytes
Contents
module PDF module Core class OutlineItem #:nodoc: attr_accessor :count, :first, :last, :next, :prev, :parent, :title, :dest, :closed def initialize(title, parent, options) @closed = options[:closed] @title = title @parent = parent @count = 0 end def to_hash hash = { :Title => title, :Parent => parent, :Count => closed ? -count : count } [{:First => first}, {:Last => last}, {:Next => defined?(@next) && @next}, {:Prev => prev}, {:Dest => dest}].each do |h| unless h.values.first.nil? hash.merge!(h) end end hash end end end end
Version data entries
10 entries across 10 versions & 1 rubygems