Class: ActiveDeliveryRpush::Driver
- Inherits:
-
Object
- Object
- ActiveDeliveryRpush::Driver
- Defined in:
- lib/active_delivery_rpush/driver.rb
Instance Method Summary collapse
- #call(params) ⇒ Object
-
#initialize(notification_klass) ⇒ Driver
constructor
A new instance of Driver.
Constructor Details
#initialize(notification_klass) ⇒ Driver
Returns a new instance of Driver.
5 6 7 |
# File 'lib/active_delivery_rpush/driver.rb', line 5 def initialize(notification_klass) @notification_klass = notification_klass end |
Instance Method Details
#call(params) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/active_delivery_rpush/driver.rb', line 9 def call(params) raise ArgumentError, "`app` must be passed as a param" unless params.fetch(:app, nil) notification = @notification_klass.new( params ) notification.save! end |