Class: Rapns::Reflections

Inherits:
Object
  • Object
show all
Defined in:
lib/rapns/reflection.rb

Defined Under Namespace

Classes: NoSuchReflectionError

Constant Summary collapse

REFLECTIONS =
[
  :apns_feedback, :notification_enqueued, :notification_delivered,
  :notification_failed, :notification_will_retry, :apns_connection_lost,
  :gcm_canonical_id, :error
]

Instance Method Summary collapse

Instance Method Details

#__dispatch(reflection, *args) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/rapns/reflection.rb', line 28

def __dispatch(reflection, *args)
  unless REFLECTIONS.include?(reflection.to_sym)
    raise NoSuchReflectionError, reflection
  end

  if reflections[reflection]
    reflections[reflection].call(*args)
  end
end