Sha256: 0ed5f3cc1191c2a75ff0d4a9d315db8156fcfa910444c440dabbc8abe1d39871

Contents?: true

Size: 682 Bytes

Versions: 10

Compression:

Stored size: 682 Bytes

Contents

module Postmark
  module SharedMessageExtensions
  
    def tag
      self['TAG']
    end

    def tag=(value)
      self['TAG'] = value
    end
  
    def postmark_attachments=(value)
      @_attachments = value.is_a?(Array) ? value : [value]
    end
  
    def postmark_attachments
      return if @_attachments.nil?
          
      @_attachments.collect do |item|
        if item.is_a?(Hash)
          item
        elsif item.is_a?(File)
          {
            "Name"        => item.path.split("/")[-1],
            "Content"     => [ IO.read(item.path) ].pack("m"),
            "ContentType" => "application/octet-stream"
          }
        end
      end
    end
  
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
postmark-0.9.10 lib/postmark/message_extensions/shared.rb
postmark-0.9.9 lib/postmark/message_extensions/shared.rb
postmark-0.9.8 lib/postmark/message_extensions/shared.rb
postmark-0.9.6 lib/postmark/message_extensions/shared.rb
postmark-0.9.5 lib/postmark/message_extensions/shared.rb
postmark-0.9.4 lib/postmark/message_extensions/shared.rb
postmark-0.9.3 lib/postmark/message_extensions/shared.rb
postmark-0.9.2 lib/postmark/message_extensions/shared.rb
postmark-0.9.1 lib/postmark/message_extensions/shared.rb
postmark-0.9.0 lib/postmark/message_extensions/shared.rb