Sha256: 2f2cecc8d41f8648f71b68bd33f2743cbfa2d6b5a95982268642a36335a6be10

Contents?: true

Size: 1.45 KB

Versions: 1

Compression:

Stored size: 1.45 KB

Contents

require 'zip/filesystem'
require 'fileutils'
require 'fastimage'
require 'erb'

module Powerpoint
  module Slide
    class Concept
      include Powerpoint::Util

      attr_reader :title, :subtitle,:page_number,:logo, :task_icon, :image_information, :images, :legend

      def initialize(options={})
        require_arguments [:title, :subtitle, :page_number, :logo, :task_icon, :image_information, :images, :legend], options
        options.each {|k, v| instance_variable_set("@#{k}", v)}
        @legend = legend
        @images = images
        @image_y_scale = image_information[1]
        @image_x_scale = image_information[0]
        @image_x_offset = image_information[2]
        @image_y_offset = image_information[3]
      end

      def save(extract_path, index)
        @images.each do |image|
          copy_media(extract_path, image)
        end
        
        copy_media(extract_path, logo)
        copy_media(extract_path, task_icon)

        save_rel_xml(extract_path, index)
        save_slide_xml(extract_path, index)
      end


      def save_rel_xml(extract_path, index)
        render_view('concept_rel.xml.erb', "#{extract_path}/ppt/slides/_rels/slide#{index}.xml.rels", index: index)
      end
      private :save_rel_xml

      def save_slide_xml(extract_path, index)
        render_view('concept.xml.erb', "#{extract_path}/ppt/slides/slide#{index}.xml")
      end
      private :save_slide_xml
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
powerpoint-pro-2.1.0.1 lib/powerpoint/slide/concept.rb