Sha256: 80444f8c1882157426ec7f15811b697d1c46c9566ec5a0772c4dcb55bee6fc10

Contents?: true

Size: 454 Bytes

Versions: 7

Compression:

Stored size: 454 Bytes

Contents

module Pixelpress
  class Preview
    def self.all
      Dir[Rails.root.join('spec', 'printers', 'previews', '**', '*_preview.rb')].map do |file|
        require_dependency file
        file.split('printers/previews/').last.sub('.rb', '').classify.constantize.new
      end
    end

    def previews
      methods - Object.methods - [:previews, :printer_name]
    end

    def printer_name
      self.class.name.underscore.tr('/', '_')
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pixelpress-0.3.2 lib/pixelpress/preview.rb
pixelpress-0.2.4 lib/pixelpress/preview.rb
pixelpress-0.2.3 lib/pixelpress/preview.rb
pixelpress-0.2.2 lib/pixelpress/preview.rb
pixelpress-0.2.1 lib/pixelpress/preview.rb
pixelpress-0.2.0 lib/pixelpress/preview.rb
pixelpress-0.1.0 lib/pixelpress/preview.rb