Sha256: d8c913badc3da06ce18c8597fccf69ea25ebe9f655b27814a413ca60ba35a050

Contents?: true

Size: 835 Bytes

Versions: 24

Compression:

Stored size: 835 Bytes

Contents

module Rpush
  module Client
    module ActiveModel
      module Adm
        module Notification
          def self.included(base)
            base.instance_eval do
              validates :registration_ids, presence: true

              validates_with Rpush::Client::ActiveModel::PayloadDataSizeValidator, limit: 6144
              validates_with Rpush::Client::ActiveModel::RegistrationIdsCountValidator, limit: 100

              validates_with Rpush::Client::ActiveModel::Adm::DataValidator
            end
          end

          def as_json
            json = { 'data' => data }
            json['consolidationKey'] = collapse_key if collapse_key
            # number of seconds before message is expired
            json['expiresAfter'] = expiry if expiry
            json
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rpush-2.6.0-java lib/rpush/client/active_model/adm/notification.rb
rpush-2.6.0 lib/rpush/client/active_model/adm/notification.rb
rpush-2.5.0 lib/rpush/client/active_model/adm/notification.rb
rpush-2.4.0-java lib/rpush/client/active_model/adm/notification.rb
rpush-2.4.0 lib/rpush/client/active_model/adm/notification.rb
rpush-2.3.2-java lib/rpush/client/active_model/adm/notification.rb
rpush-2.3.2 lib/rpush/client/active_model/adm/notification.rb
rpush-2.3.1-java lib/rpush/client/active_model/adm/notification.rb
rpush-2.3.1 lib/rpush/client/active_model/adm/notification.rb
rpush-2.3.0-java lib/rpush/client/active_model/adm/notification.rb
rpush-2.3.0 lib/rpush/client/active_model/adm/notification.rb
rpush-2.3.0.rc1 lib/rpush/client/active_model/adm/notification.rb
rpush-2.2.0-java lib/rpush/client/active_model/adm/notification.rb
rpush-2.2.0 lib/rpush/client/active_model/adm/notification.rb
rpush-2.1.0-java lib/rpush/client/active_model/adm/notification.rb
rpush-2.1.0 lib/rpush/client/active_model/adm/notification.rb
rpush-2.0.1-java lib/rpush/client/active_model/adm/notification.rb
rpush-2.0.1 lib/rpush/client/active_model/adm/notification.rb
rpush-2.0.0-java lib/rpush/client/active_model/adm/notification.rb
rpush-2.0.0 lib/rpush/client/active_model/adm/notification.rb