Class: Pushing::Platforms::FcmPayload

Inherits:
Object
  • Object
show all
Defined in:
lib/pushing/platforms.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ FcmPayload

Returns a new instance of FcmPayload.



86
87
88
# File 'lib/pushing/platforms.rb', line 86

def initialize(payload, *)
  @payload = payload
end

Instance Attribute Details

#payloadObject (readonly)

Returns the value of attribute payload.



80
81
82
# File 'lib/pushing/platforms.rb', line 80

def payload
  @payload
end

Class Method Details

.should_render?(options) ⇒ Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/pushing/platforms.rb', line 82

def self.should_render?(options)
  options.present?
end

Instance Method Details

#recipientsObject



90
91
92
# File 'lib/pushing/platforms.rb', line 90

def recipients
  Array(payload[:to] || payload[:registration_ids])
end