Sha256: f15721236da25900a3902c5ae24b019930480f0538fd905d492d6b040fb28d25

Contents?: true

Size: 402 Bytes

Versions: 2

Compression:

Stored size: 402 Bytes

Contents

module GCM
  class NotificationResponse
    
    def initialize(response)
      @response = response
    end
    
    def success?
      @response.success?
    end
    
    def device_unsubscribed?
      @response.validation_error? &&
      @response.body['errors'] &&
      @response.body['errors']['device'] &&
      @response.body['errors']['device'].include?('unsubscribed')
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gcm-client-1.0.1 lib/gcm/notification_response.rb
gcm-client-1.0.0 lib/gcm/notification_response.rb