class PDD::Rule::Estimate::Min
Rule
for min estimate.
Public Class Methods
new(xml, min)
click to toggle source
Ctor.
xml
-
XML with puzzles
# File lib/pdd/rule/estimates.rb, line 28 def initialize(xml, min) @xml = xml @min = min.to_i end
Public Instance Methods
errors()
click to toggle source
# 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