From 38e4d877abee3c8e40edd932057e2bf16ad01e13 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Fri, 16 Sep 2011 12:47:52 +0100 Subject: Big documentation update. --- lib/mauve/people_list.rb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'lib/mauve/people_list.rb') diff --git a/lib/mauve/people_list.rb b/lib/mauve/people_list.rb index b15db3f..6b2ba33 100644 --- a/lib/mauve/people_list.rb +++ b/lib/mauve/people_list.rb @@ -4,14 +4,18 @@ require 'mauve/calendar_interface' module Mauve - # Stores a list of name. + # Stores a list of Mauve::Person + # # - # @author Yann Golanski class PeopleList attr_reader :label, :list - # Default contrustor. + # Create a new list + # + # @param [String] label The name of the list + # @raise [ArgumentError] if the label is not a string + # def initialize(label) raise ArgumentError, "people_list label must be a string" unless label.is_a?(String) @label = label @@ -20,6 +24,10 @@ module Mauve alias username label + # Append an Array or String to a list + # + # @param [Array or String] arr + # @return [Mauve::PeopleList] self def +(arr) case arr when Array @@ -44,15 +52,14 @@ module Mauve alias add_to_list + - # - # Set up the logger + # @return Log4r::Logger def logger @logger ||= Log4r::Logger.new self.class.to_s end - # # Return the array of people # + # @return [Array] def people l = list.collect do |name| -- cgit v1.2.1