class LuigiProjectsList

Public Instance Methods

lookup_by_anything(thing, value) click to toggle source
# File lib/luigi_projects_list.rb, line 12
def lookup_by_anything thing, value
  raise "#{thing}" unless [:name, :date, :index].include? thing

  selection = self.map{|project|
    if project.methods.include? thing  and project.method(thing).call.to_s.downcase.include? value.to_s.downcase
      project
    end
  }
  selection.select{|p|p}
end
lookup_by_date(date) click to toggle source
# File lib/luigi_projects_list.rb, line 27
def lookup_by_date date
  self.lookup_by_anything :date, date
end
lookup_by_index(index) click to toggle source
# File lib/luigi_projects_list.rb, line 23
def lookup_by_index index
  self.lookup_by_anything :index, index
end
lookup_by_name(name) click to toggle source
# File lib/luigi_projects_list.rb, line 31
def lookup_by_name name
  self.lookup_by_anything :name, name
end