Sha256: e33e798b621c2c05d27d2a74d91656cde888cc5d2910ffa3f8ea2d3fdef88e24

Contents?: true

Size: 450 Bytes

Versions: 13

Compression:

Stored size: 450 Bytes

Contents

module PDF
  class Wrapper

    # a proxy to a PDF::Wrapper object that disallows new pages
    class Page

      def initialize(pdf)
        @pdf = pdf
      end

      def method_missing(method, *args, &block)
        if method.to_sym == :start_new_page
          raise InvalidOperationError, 'start_new_page is not allowed in the current context'
        else
          @pdf.__send__(method, *args, &block)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
pdf-wrapper-0.4.5 lib/pdf/wrapper/page.rb
pdf-wrapper-0.4.4 lib/pdf/wrapper/page.rb
pdf-wrapper-0.4.1 lib/pdf/wrapper/page.rb
pdf-wrapper-0.4.0 lib/pdf/wrapper/page.rb
pdf-wrapper-0.3.5 lib/pdf/wrapper/page.rb
pdf-wrapper-0.3.4 lib/pdf/wrapper/page.rb
pdf-wrapper-0.3.3 lib/pdf/wrapper/page.rb
pdf-wrapper-0.3.2 lib/pdf/wrapper/page.rb
pdf-wrapper-0.3.1 lib/pdf/wrapper/page.rb
pdf-wrapper-0.3.0 lib/pdf/wrapper/page.rb
pdf-wrapper-0.2.0 lib/pdf/wrapper/page.rb
pdf-wrapper-0.2.1 lib/pdf/wrapper/page.rb
pdf-wrapper-0.1.3 lib/pdf/wrapper/page.rb