Module: Redmine::Activity
- Defined in:
- lib/redmine/activity.rb,
lib/redmine/activity/fetcher.rb
Defined Under Namespace
Classes: Fetcher
Constant Summary collapse
- @@available_event_types =
[]
- @@default_event_types =
[]
- @@providers =
Hash.new {|h, k| h[k]=[]}
Class Method Summary collapse
- .delete(event_type) ⇒ Object
- .map {|_self| ... } ⇒ Object
-
.register(event_type, options = {}) ⇒ Object
Registers an activity provider.
Class Method Details
.delete(event_type) ⇒ Object
47 48 49 50 51 |
# File 'lib/redmine/activity.rb', line 47 def delete(event_type) @@available_event_types.delete event_type @@default_event_types.delete event_type @@providers.delete(event_type) end |
.map {|_self| ... } ⇒ Object
30 31 32 |
# File 'lib/redmine/activity.rb', line 30 def map(&block) yield self end |
.register(event_type, options = {}) ⇒ Object
Registers an activity provider
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/redmine/activity.rb', line 35 def register(event_type, ={}) .assert_valid_keys(:class_name, :default) event_type = event_type.to_s providers = [:class_name] || event_type.classify providers = ([] << providers) unless providers.is_a?(Array) @@available_event_types << event_type unless @@available_event_types.include?(event_type) @@default_event_types << event_type unless [:default] == false @@providers[event_type] += providers end |