Sha256: 94800ad803171835e40de470af2f8c1ea6c98aae14a160d0c11fed329e172d7a

Contents?: true

Size: 578 Bytes

Versions: 9

Compression:

Stored size: 578 Bytes

Contents

module Rpush
  module Client
    module ActiveModel
      module Wpns
        module Notification
          def self.included(base)
            base.instance_eval do
              validates :uri, presence: true
              validates :uri, format: { with: %r{https?://[\S]+} }
              validates :data, presence: true
            end
            def alert=(value)
              return unless value
              data = self.data || {}
              data['title'] = value
              self.data = data
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rpush-2.4.0-java lib/rpush/client/active_model/wpns/notification.rb
rpush-2.4.0 lib/rpush/client/active_model/wpns/notification.rb
rpush-2.3.2-java lib/rpush/client/active_model/wpns/notification.rb
rpush-2.3.2 lib/rpush/client/active_model/wpns/notification.rb
rpush-2.3.1-java lib/rpush/client/active_model/wpns/notification.rb
rpush-2.3.1 lib/rpush/client/active_model/wpns/notification.rb
rpush-2.3.0-java lib/rpush/client/active_model/wpns/notification.rb
rpush-2.3.0 lib/rpush/client/active_model/wpns/notification.rb
rpush-2.3.0.rc1 lib/rpush/client/active_model/wpns/notification.rb