Sha256: f2d094c53b5834ca3a7b587014c0d935da9a0e7b020f739fca575971d46e0840

Contents?: true

Size: 544 Bytes

Versions: 4

Compression:

Stored size: 544 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'test_helper'
require 'hexapdf/content/processor'

module TestHelper

  # Can be used to to record operators parsed from content streams.
  class OperatorRecorder < HexaPDF::Content::Processor

    undef :paint_xobject

    attr_reader :recorded_ops

    def initialize
      super
      operators.clear
      @recorded_ops = []
    end

    def respond_to_missing?(*)
      true
    end

    def method_missing(msg, *params)
      @recorded_ops << (params.empty? ? [msg] : [msg, params])
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hexapdf-0.4.0 test/hexapdf/content/common.rb
hexapdf-0.3.0 test/hexapdf/content/common.rb
hexapdf-0.2.0 test/hexapdf/content/common.rb
hexapdf-0.1.0 test/hexapdf/content/common.rb