Sha256: 56edaf4b18f87d8f28c1df929ec7d131ddbaaac7dcd6ee6a24d39e6ad791aa4f
Contents?: true
Size: 801 Bytes
Versions: 6
Compression:
Stored size: 801 Bytes
Contents
# Holds information about a recipient's email event, like deliveries and bounces. class MailCannon::Stamp include Mongoid::Document include Mongoid::Timestamps embedded_in :envelope field :code, type: Integer, default: 0 field :recipient # email address for this "notification" validates :code, presence: true # Returns the Event for this Stamp. def event MailCannon::Event.from_code(self.code) end # Creates a Stamp from an Event code. # @param code Can be either an Integer, a MailCannon::Event or the MailCannon::Stamp itself. def self.from_code(code) if code.is_a? Fixnum return MailCannon::Stamp.new({code: code}) elsif code.is_a? MailCannon::Stamp return code else # MailCannon::Event::* return code.stamp end end end
Version data entries
6 entries across 6 versions & 1 rubygems