Sha256: cf0279ec78d972c6cee613ead7e10711bc0afbbdb74fe885ed580ae90b473594

Contents?: true

Size: 702 Bytes

Versions: 53

Compression:

Stored size: 702 Bytes

Contents

module Postmark
  module Inbound
    extend self

    def to_ruby_hash(inbound)
      inbound = Json.decode(inbound) if inbound.is_a?(String)
      ret = HashHelper.to_ruby(inbound)
      ret[:from_full] ||= {}
      ret[:to_full] ||= []
      ret[:cc_full] ||= []
      ret[:headers] ||= []
      ret[:attachments] ||= []
      ret[:from_full] = HashHelper.to_ruby(ret[:from_full])
      ret[:to_full] = ret[:to_full].map { |to| HashHelper.to_ruby(to) }
      ret[:cc_full] = ret[:cc_full].map { |cc| HashHelper.to_ruby(cc) }
      ret[:headers] = ret[:headers].map { |h| HashHelper.to_ruby(h) }
      ret[:attachments] = ret[:attachments].map { |a| HashHelper.to_ruby(a) }
      ret
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
postmark-1.4.2 lib/postmark/inbound.rb
postmark-1.4.1 lib/postmark/inbound.rb
postmark-1.4.0 lib/postmark/inbound.rb
postmark-1.3.1 lib/postmark/inbound.rb
postmark-1.3.0 lib/postmark/inbound.rb
postmark-1.2.1 lib/postmark/inbound.rb
postmark-1.2.0 lib/postmark/inbound.rb
postmark-1.1.2 lib/postmark/inbound.rb
postmark-1.1.1 lib/postmark/inbound.rb
postmark-1.1.0 lib/postmark/inbound.rb
postmark-1.0.2 lib/postmark/inbound.rb
postmark-1.0.1 lib/postmark/inbound.rb
postmark-1.0.0 lib/postmark/inbound.rb