Module: Redmine::Acts::Event::InstanceMethods

Defined in:
lib/plugins/acts_as_event/lib/acts_as_event.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



42
43
44
# File 'lib/plugins/acts_as_event/lib/acts_as_event.rb', line 42

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#event_dateObject



62
63
64
# File 'lib/plugins/acts_as_event/lib/acts_as_event.rb', line 62

def event_date
  event_datetime.to_date
end

#event_groupObject



66
67
68
69
# File 'lib/plugins/acts_as_event/lib/acts_as_event.rb', line 66

def event_group
  group = event_options[:group] ? send(event_options[:group]) : self
  group || self
end

#event_url(options = {}) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/plugins/acts_as_event/lib/acts_as_event.rb', line 71

def event_url(options = {})
  option = event_options[:url]
  if option.is_a?(Proc)
    option.call(self).merge(options)
  elsif option.is_a?(Hash)
    option.merge(options)
  elsif option.is_a?(Symbol)
    send(option).merge(options)
  else
    option
  end
end

#recipientsObject

Returns the mail addresses of users that should be notified



85
86
87
88
89
# File 'lib/plugins/acts_as_event/lib/acts_as_event.rb', line 85

def recipients
  notified = project.notified_users
  notified.reject! {|user| !visible?(user)}
  notified.collect(&:mail)
end