Class: ASF::ICLA

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/whimsy/asf/icla.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.availids ⇒ Object



26
27
28
29
30
31
# File 'lib/whimsy/asf/icla.rb', line 26

def self.availids
  return @availids if @availids
  availids = []
  ICLA.new.each {|id, name, email| availids << id unless id == 'notinavail'}
  @availids = availids
end

.find_by_email(value) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/whimsy/asf/icla.rb', line 16

def self.find_by_email(value)
  value = value.downcase
  ICLA.new.each do |id, name, email|
    if email.downcase == value
	  return Struct.new(:id, :name, :email).new(id, name, email)
    end 
  end
  nil
end

.find_by_id(value) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/whimsy/asf/icla.rb', line 6

def self.find_by_id(value)
  return if value == 'notinavail'
  new.each do |id, name, email|
    if id == value
	  return Struct.new(:id, :name, :email).new(id, name, email)
    end 
  end
  nil
end

Instance Method Details

#each(&block) ⇒ Object



33
34
35
36
37
# File 'lib/whimsy/asf/icla.rb', line 33

def each(&block)
  officers = ASF::SVN['private/foundation/officers']
  iclas = File.read("#{officers}/iclas.txt")
  iclas.scan(/^([-\w]+):.*?:(.*?):(.*?):/).each(&block)
end