Sha256: 227239b47722d4847d48a948f0eaf3e161ede52e65d3e03a5c3bc51324d20f3c

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

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

module Powerpoint
  module Slide
    class ExtendedIntro
      include Powerpoint::Util

      attr_reader :title, :subtitle, :subtitle_2, :coords, :image_path, :image_path_2, :image_name

      def initialize(options={})
        require_arguments [:title, :subtitle, :image_path, :image_path_2, :subtitle_2], options
        options.each {|k, v| instance_variable_set("@#{k}", v)}
        @image_name = File.basename(@image_path)
        @image_name_2 = File.basename(@image_path_2)
      end

      def save(extract_path, index)
        copy_media(extract_path, @image_path)
        copy_media(extract_path, @image_path_2)
        save_rel_xml(extract_path, index)
        save_slide_xml(extract_path, index)
      end

      def save_rel_xml(extract_path, index)
        render_view('extended_intro_slide_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('extended_intro_slide.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/extended_intro.rb