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.25.1 lib/postmark/inbound.rb
postmark-1.25.0 lib/postmark/inbound.rb
postmark-1.24.1 lib/postmark/inbound.rb
postmark-1.24.0 lib/postmark/inbound.rb
postmark-1.23.0 lib/postmark/inbound.rb
postmark-1.22.3 lib/postmark/inbound.rb
postmark-1.22.2 lib/postmark/inbound.rb
postmark-1.22.1 lib/postmark/inbound.rb
postmark-1.22.0 lib/postmark/inbound.rb
postmark-1.21.8 lib/postmark/inbound.rb
postmark-1.21.7 lib/postmark/inbound.rb
postmark-1.21.6 lib/postmark/inbound.rb
postmark-1.21.5 lib/postmark/inbound.rb
postmark-1.21.4 lib/postmark/inbound.rb
postmark-1.21.3 lib/postmark/inbound.rb
postmark-1.21.2 lib/postmark/inbound.rb
postmark-1.21.1 lib/postmark/inbound.rb
postmark-1.21.0 lib/postmark/inbound.rb
postmark-1.20.0 lib/postmark/inbound.rb
postmark-1.19.2 lib/postmark/inbound.rb