Sha256: 4a7d17014711d3b6121c53fb6c80f7d60822080ba9bbb81d9a2cc9c4f97ad686

Contents?: true

Size: 506 Bytes

Versions: 12

Compression:

Stored size: 506 Bytes

Contents

class Onceover
  class Class
    @@all = []

    attr_accessor :name
    def initialize(name)
      @name = name
      @@all << self
    end

    def self.find(class_name)
      @@all.each do |cls|
        if class_name.is_a?(Onceover::Class)
          if cls = class_name
            return cls
          end
        elsif cls.name == class_name
          return cls
        end
      end
      logger.warn "Class #{class_name} not found"
      nil
    end

    def self.all
      @@all
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
onceover-3.0.11 lib/onceover/class.rb
onceover-3.0.10 lib/onceover/class.rb
onceover-3.0.9 lib/onceover/class.rb
onceover-3.0.8 lib/onceover/class.rb
onceover-3.0.7 lib/onceover/class.rb
onceover-3.0.6 lib/onceover/class.rb
onceover-3.0.5 lib/onceover/class.rb
onceover-3.0.4 lib/onceover/class.rb
onceover-3.0.3 lib/onceover/class.rb
onceover-3.0.2 lib/onceover/class.rb
onceover-3.0.1 lib/onceover/class.rb
onceover-3.0.0 lib/onceover/class.rb