Sha256: 20bc51f96d0aa4120dfe85e5a3d4ac1e478a8705ca400c49a9b2b57656eb056a

Contents?: true

Size: 423 Bytes

Versions: 5

Compression:

Stored size: 423 Bytes

Contents

class MessengerPlatform::MessageBase

  attr_reader :recipient, :notification_type

  def initialize(recipient, notification_type = :regular)
    @recipient = recipient
    @notification_type = notification_type
  end

  def serialize
    {
      recipient: recipient.serialize,
      notification_type: notification_type.to_s.upcase
    }
  end

  def deliver
    MessengerPlatform::MessageSender.deliver(self)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
messenger_platform_rails-0.5.1 lib/messenger_platform/message_base.rb
messenger_platform_rails-0.5.0 lib/messenger_platform/message_base.rb
messenger_platform_rails-0.4.0 lib/messenger_platform/message_base.rb
messenger_platform_rails-0.3.0 lib/messenger_platform/message_base.rb
messenger_platform_rails-0.2.0 lib/messenger_platform/message_base.rb