Sha256: 14877a644c9dd7634f812a581a0ddfabdfcc74d017b558c043e7dce427f153b0
Contents?: true
Size: 472 Bytes
Versions: 10
Compression:
Stored size: 472 Bytes
Contents
class ProjectCatalog def initialize @projects = [] end def projects criteria = nil result = @projects.sort_by(&:name) return result if criteria.blank? result.find_all { |project| project.instance_eval criteria } end def add_project project @projects << project self end def save @projects.all? &:save self end def load @projects = Project.all self end def self.load self.new.load end end
Version data entries
10 entries across 10 versions & 1 rubygems