class ActsAsNotifiableRedmine::Couriers::PusherCourier
Public Class Methods
def_field(*names)
click to toggle source
# 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
new(&block)
click to toggle source
# 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
Public Instance Methods
send_notification(channels, event, options)
click to toggle source
# File lib/acts_as_notifiable_redmine/couriers/pusher_courier.rb, line 35 def send_notification(channels, event, options) Pusher.trigger(channels, event, options) end
Private Instance Methods
setup_pusher()
click to toggle source
# File lib/acts_as_notifiable_redmine/couriers/pusher_courier.rb, line 43 def setup_pusher Pusher.app_id = @app_id Pusher.key = @key Pusher.secret = @secret Pusher.encrypted = @encrypted end