Class: Judges::Judges
Overview
Collection of all judges to run.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2024 Yegor Bugayenko
- License
-
MIT
Instance Method Summary collapse
-
#each {|Judge| ... } ⇒ Object
Iterate over them all.
-
#each_with_index {|(Judge, Integer)| ... } ⇒ Object
Iterate over them all.
-
#get(name) ⇒ Judge
Get one judge by name.
-
#initialize(dir, lib, loog) ⇒ Judges
constructor
A new instance of Judges.
Constructor Details
#initialize(dir, lib, loog) ⇒ Judges
Returns a new instance of Judges.
31 32 33 34 35 |
# File 'lib/judges/judges.rb', line 31 def initialize(dir, lib, loog) @dir = dir @lib = lib @loog = loog end |
Instance Method Details
#each {|Judge| ... } ⇒ Object
Iterate over them all.
47 48 49 50 51 52 |
# File 'lib/judges/judges.rb', line 47 def each Dir.glob(File.join(@dir, '**/*.rb')).each do |f| d = File.dirname(File.absolute_path(f)) yield Judges::Judge.new(d, @lib, @loog) end end |
#each_with_index {|(Judge, Integer)| ... } ⇒ Object
Iterate over them all.
56 57 58 59 60 61 62 63 |
# File 'lib/judges/judges.rb', line 56 def each_with_index idx = 0 each do |p| yield [p, idx] idx += 1 end idx end |