Class: PDD::Rule::Estimate::Min
- Inherits:
-
Object
- Object
- PDD::Rule::Estimate::Min
- Defined in:
- lib/pdd/rule/estimates.rb
Overview
Rule for min estimate.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(xml, min) ⇒ Min
constructor
Ctor.
Constructor Details
#initialize(xml, min) ⇒ Min
Ctor.
xml
-
XML with puzzles
28 29 30 31 |
# File 'lib/pdd/rule/estimates.rb', line 28 def initialize(xml, min) @xml = xml @min = min.to_i end |
Instance Method Details
#errors ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/pdd/rule/estimates.rb', line 33 def errors @xml.xpath("//puzzle[number(estimate) < #{@min}]").map do |p| "Puzzle #{p.xpath('file/text()')}:#{p.xpath('lines/text()')}"\ " has an estimate of #{p.xpath('estimate/text()')} minutes,"\ " which is lower than #{@min} minutes" end end |