aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/people_list.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-04-13 17:03:16 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-04-13 17:03:16 +0100
commit89a67770e66d11740948e90a41db6cee0482cf8e (patch)
treebe858515fb789a89d68f94975690ab019813726c /lib/mauve/people_list.rb
new version.
Diffstat (limited to 'lib/mauve/people_list.rb')
-rw-r--r--lib/mauve/people_list.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/mauve/people_list.rb b/lib/mauve/people_list.rb
new file mode 100644
index 0000000..2e4c737
--- /dev/null
+++ b/lib/mauve/people_list.rb
@@ -0,0 +1,44 @@
+# encoding: UTF-8
+require 'log4r'
+require 'mauve/calendar_interface'
+
+module Mauve
+
+ # Stores a list of name.
+ #
+ # @author Yann Golanski
+ class PeopleList < Struct.new(:label, :list)
+
+ # Default contrustor.
+ def initialize (*args)
+ super(*args)
+ end
+
+ def label
+ self[:label]
+ end
+
+ alias username label
+
+ def list
+ self[:list]
+ end
+
+ #
+ # Set up the logger
+ def logger
+ @logger ||= Log4r::Logger.new self.class
+ end
+
+ #
+ # Return the array of people
+ #
+ def people
+ list.collect do |name|
+ Configuration.current.people.has_key?(name) ? Configuration.current.people[name] : nil
+ end.reject{|person| person.nil?}
+ end
+
+ end
+
+end