Class: ActsAsNotifiableRedmine::Couriers::PusherCourier
- Inherits:
-
Object
- Object
- ActsAsNotifiableRedmine::Couriers::PusherCourier
- Defined in:
- lib/acts_as_notifiable_redmine/couriers/pusher_courier.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(&block) ⇒ PusherCourier
constructor
A new instance of PusherCourier.
- #send_notification(channels, event, options) ⇒ Object
Constructor Details
#initialize(&block) ⇒ PusherCourier
Returns a new instance of PusherCourier.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/acts_as_notifiable_redmine/couriers/pusher_courier.rb', line 23 def initialize(&block) @name = 'Pusher' @app_id = '' @key = '' @secret = '' @encrypted = true instance_eval(&block) setup_pusher end |
Class Method Details
.def_field(*names) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/acts_as_notifiable_redmine/couriers/pusher_courier.rb', line 9 def def_field(*names) class_eval do names.each do |name| define_method(name) do |*args| args.empty? ? instance_variable_get("@#{name}") : instance_variable_set("@#{name}", *args) end end end end |
Instance Method Details
#send_notification(channels, event, options) ⇒ Object
35 36 37 |
# File 'lib/acts_as_notifiable_redmine/couriers/pusher_courier.rb', line 35 def send_notification(channels, event, ) Pusher.trigger(channels, event, ) end |