Sha256: 22b0d96f92cfbb137f6ca2b2341289006daabddbecc7814f71eef7c498a95868

Contents?: true

Size: 525 Bytes

Versions: 12

Compression:

Stored size: 525 Bytes

Contents

require 'rabbit/element/slide'
require 'rabbit/element/poppler-page'

module Rabbit
  module Element
    class PopplerSlide < Slide
      def initialize(page)
        @raw_page = page
        @page = PopplerPage.new(page)
        super(@page)
      end

      def headline
        @page
      end

      def body
        @page
      end

      def title
        (@page.text.split(/\r?\n/, 2)[0] || super).chomp
      end

      def size_ratio
        w, h = @raw_page.size
        w.to_f / h.to_f
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rabbit-3.0.3 lib/rabbit/element/poppler-slide.rb
rabbit-3.0.2 lib/rabbit/element/poppler-slide.rb
rabbit-3.0.1 lib/rabbit/element/poppler-slide.rb
rabbit-3.0.0 lib/rabbit/element/poppler-slide.rb
rabbit-2.2.1 lib/rabbit/element/poppler-slide.rb
rabbit-2.2.0 lib/rabbit/element/poppler-slide.rb
rabbit-2.1.9 lib/rabbit/element/poppler-slide.rb
rabbit-2.1.8 lib/rabbit/element/poppler-slide.rb
rabbit-2.1.7 lib/rabbit/element/poppler-slide.rb
rabbit-2.1.6 lib/rabbit/element/poppler-slide.rb
rabbit-2.1.5 lib/rabbit/element/poppler-slide.rb
rabbit-2.1.4 lib/rabbit/element/poppler-slide.rb