Class: Trackler::Problems
- Inherits:
-
Object
- Object
- Trackler::Problems
- Includes:
- Enumerable
- Defined in:
- lib/trackler/problems.rb
Overview
Problems is the collection of problems that we have metadata for.
Constant Summary collapse
- SLUG_PATTERN =
Regexp.new(".*\/exercises\/([^\/]*)\/")
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#-(slugs) ⇒ Object
rubocop:disable Style/OpMethod.
- #[](slug) ⇒ Object
- #each ⇒ Object
-
#initialize(root) ⇒ Problems
constructor
A new instance of Problems.
Constructor Details
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
8 9 10 |
# File 'lib/trackler/problems.rb', line 8 def root @root end |
Instance Method Details
#-(slugs) ⇒ Object
rubocop:disable Style/OpMethod
24 25 26 |
# File 'lib/trackler/problems.rb', line 24 def -(slugs) (by_slug.keys - slugs).sort end |
#[](slug) ⇒ Object
19 20 21 |
# File 'lib/trackler/problems.rb', line 19 def [](slug) by_slug[slug] end |
#each ⇒ Object
13 14 15 16 17 |
# File 'lib/trackler/problems.rb', line 13 def each all.each do |problem| yield problem end end |