Module: PaperPlane

Extended by:
ActiveSupport::Autoload
Defined in:
lib/paper_plane/base.rb,
lib/paper_plane.rb,
lib/paper_plane/fly_job.rb,
lib/paper_plane/railtie.rb,
lib/paper_plane/version.rb,
lib/paper_plane/callbacks.rb,
lib/paper_plane/flight_routes/sms.rb,
lib/paper_plane/flight_routes/base.rb,
lib/paper_plane/flight_routes/email.rb,
lib/paper_plane/flight_routes/class_methods.rb

Overview

defines PaperPlane::Base, the dad of all paper_planes.

Defined Under Namespace

Modules: Callbacks, FlightRoutes Classes: Base, FlyJob, Railtie

Constant Summary collapse

VERSION =
"0.1.1"
CALLBACK_TERMINATOR =

Add callbacks support to Active Delivery (requires ActiveSupport::Callbacks)

# Run method before delivering notification
# NOTE: when `false` is returned the executation is halted
before_fly :do_something

# You can specify a notification method (to run callback only for that method)
before_fly :do_mail_something, on: :mail

# or for push notifications
before_fly :do_mail_something, on: :push

# after_ and around_ callbacks are also supported
after_fly :cleanup

around_fly :set_context
if ::ActiveSupport::VERSION::MAJOR >= 5
  ->(_target, result) { result.call == false }
else
  ->(_target, result) { result == false }
end