Sha256: 2c03be508975e7a2753f0d42b8e6f5ccf0947223ca7d7fd2a8d905c678bca5ac

Contents?: true

Size: 596 Bytes

Versions: 3

Compression:

Stored size: 596 Bytes

Contents

module HtmlEmailCreator
  class EmailVersion    
    def initialize(formatter, output_basename, settings)
      @formatter = formatter
      @output_basename = output_basename
      @settings = settings
    end

    def get
      @formatter.format
    end
    
    def id
      @formatter.id
    end

    def save
      FileUtils.mkdir_p(@settings.output_path) unless File.exists?(@settings.output_path)
      file = File.join(@settings.output_path, "#{@output_basename}.#{@formatter.extension}")
      File.open(file, "w") do |file|
        file.write(get)
      end
      file
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
html_email_creator-1.0.2 lib/html_email_creator/email_version.rb
html_email_creator-1.0.1 lib/html_email_creator/email_version.rb
html_email_creator-1.0.0 lib/html_email_creator/email_version.rb