Class: Prawn::OutlineItem
- Inherits:
-
Object
- Object
- Prawn::OutlineItem
- Defined in:
- lib/prawn/outline.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#closed ⇒ Object
Returns the value of attribute closed.
-
#count ⇒ Object
Returns the value of attribute count.
-
#dest ⇒ Object
Returns the value of attribute dest.
-
#first ⇒ Object
Returns the value of attribute first.
-
#last ⇒ Object
Returns the value of attribute last.
-
#next ⇒ Object
Returns the value of attribute next.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#prev ⇒ Object
Returns the value of attribute prev.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title, parent, options) ⇒ OutlineItem
constructor
A new instance of OutlineItem.
- #to_hash ⇒ Object
Constructor Details
#initialize(title, parent, options) ⇒ OutlineItem
Returns a new instance of OutlineItem.
257 258 259 260 261 262 |
# File 'lib/prawn/outline.rb', line 257 def initialize(title, parent, ) @closed = [:closed] @title = title @parent = parent @count = 0 end |
Instance Attribute Details
#closed ⇒ Object
Returns the value of attribute closed.
255 256 257 |
# File 'lib/prawn/outline.rb', line 255 def closed @closed end |
#count ⇒ Object
Returns the value of attribute count.
255 256 257 |
# File 'lib/prawn/outline.rb', line 255 def count @count end |
#dest ⇒ Object
Returns the value of attribute dest.
255 256 257 |
# File 'lib/prawn/outline.rb', line 255 def dest @dest end |
#first ⇒ Object
Returns the value of attribute first.
255 256 257 |
# File 'lib/prawn/outline.rb', line 255 def first @first end |
#last ⇒ Object
Returns the value of attribute last.
255 256 257 |
# File 'lib/prawn/outline.rb', line 255 def last @last end |
#next ⇒ Object
Returns the value of attribute next.
255 256 257 |
# File 'lib/prawn/outline.rb', line 255 def next @next end |
#parent ⇒ Object
Returns the value of attribute parent.
255 256 257 |
# File 'lib/prawn/outline.rb', line 255 def parent @parent end |
#prev ⇒ Object
Returns the value of attribute prev.
255 256 257 |
# File 'lib/prawn/outline.rb', line 255 def prev @prev end |
#title ⇒ Object
Returns the value of attribute title.
255 256 257 |
# File 'lib/prawn/outline.rb', line 255 def title @title end |
Instance Method Details
#to_hash ⇒ Object
264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/prawn/outline.rb', line 264 def to_hash hash = { :Title => Prawn::Core::LiteralString.new(title), :Parent => parent, :Count => closed ? -count : count } [{:First => first}, {:Last => last}, {:Next => @next}, {:Prev => prev}, {:Dest => dest}].each do |h| unless h.values.first.nil? hash.merge!(h) end end hash end |