class ActsAsNotifiableRedmine::Channel
Attributes
events[R]
identifier[R]
name[R]
Public Class Methods
new(id, &block)
click to toggle source
# File lib/acts_as_notifiable_redmine/channel.rb, line 6 def initialize(id, &block) @id = id.to_sym @name = @id @identifier = "channel_#{name}" @events = [] @target = "#{name}" instance_eval(&block) end
Public Instance Methods
event(name, options = {})
click to toggle source
# File lib/acts_as_notifiable_redmine/channel.rb, line 31 def event(name, options = {}) new_event = Event.new(name, options) @events.push(new_event) end
target(target)
click to toggle source
# File lib/acts_as_notifiable_redmine/channel.rb, line 17 def target(target) @target = target end
token()
click to toggle source
# File lib/acts_as_notifiable_redmine/channel.rb, line 22 def token if @target.is_a?(Proc) "#{@name}-#{@target.call(self)}" else @target end end