Sha256: a4cc38a1f9301ae83d1a9926babf5bd89a064b61bf679055039afe73c7e415a1

Contents?: true

Size: 775 Bytes

Versions: 1

Compression:

Stored size: 775 Bytes

Contents

require 'fileutils'
require 'erb'

module Powerpoint
  module Slide
    class Intro
      include Powerpoint::Util
      
      attr_reader :title, :subtitile

      def initialize(options={})
        require_arguments [:title, :subtitile], options
        options.each {|k, v| instance_variable_set("@#{k}", v)}
      end

      def save(index)
        save_rel_xml(index)
        save_slide_xml(index)
      end

      private

      def save_rel_xml index
        File.open("#{extract_path}/ppt/slides/_rels/slide#{index}.xml.rels", 'w'){ |f| f << render_view('textual_rel.xml.erb') }
      end

      def save_slide_xml index
        File.open("#{extract_path}/ppt/slides/slide#{index}.xml", 'w'){ |f| f << render_view('intro_slide.xml.erb') }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
powerpoint-1.6 lib/powerpoint/slide/intro.rb