# File lib/sup/account.rb, line 73 def account_for email if(a = @email_map[email]) a else @regexen.argfind { |re, a| re =~ email && a } end end
must be called first with the default account. fills in missing values from the default account.
# File lib/sup/account.rb, line 46 def add_account hash, default=false raise ArgumentError, "no email specified for account" unless hash[:email] unless default [:name, :sendmail, :signature].each { |k| hash[k] ||= @default_account.send(k) } end hash[:alternates] ||= [] a = Account.new hash @accounts[a] = true if default raise ArgumentError, "multiple default accounts" if @default_account @default_account = a end ([hash[:email]] + hash[:alternates]).each do |email| next if @email_map.member? email @email_map[email] = a end hash[:regexen].each do |re| @regexen[Regexp.new(re)] = a end if hash[:regexen] end
# File lib/sup/account.rb, line 71 def is_account? p; is_account_email? p.email end
# File lib/sup/account.rb, line 72 def is_account_email? email; !account_for(email).nil? end
Generated with the Darkfish Rdoc Generator 2.