Class: JotPDF::Core::DictionaryWriteContext

Inherits:
WriteContext show all
Defined in:
lib/jot_pdf/core.rb

Instance Method Summary collapse

Methods inherited from WriteContext

#dsl, #initialize, #objects

Constructor Details

This class inherits a constructor from JotPDF::Core::WriteContext

Instance Method Details

#entry(name, &block) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/jot_pdf/core.rb', line 80

def entry(name, &block)
  @writer << "/#{name}"
  if block
    ObjectWriteContext.new(@writer).dsl(&block)
    @writer << "\n"
  else
    # TODO: Why does this need annotation?
    # @type var finalizer: ^() -> ObjectRef
    finalizer = proc { @writer << "\n" }
    ObjectInterm.new(writer: @writer, finalizer:)
  end
end