lib/est/estimate.rb in est-0.1 vs lib/est/estimate.rb in est-0.2
- old
+ new
@@ -38,15 +38,10 @@
def initialize(file)
@yaml = YAML.load_file(file)
fail "failed to read file #{file}" unless @yaml
end
- # Get id.
- def id
- @yaml['id']
- end
-
# Get date.
def date
Date.strptime(@yaml['date'], '%d-%m-%Y')
end
@@ -58,8 +53,20 @@
# Get total estimate.
def total
method = @yaml['method']
fail "unsupported method #{method}" unless method == 'champions.pert'
Champions.new(@yaml).total
+ end
+
+ # Constant estimate.
+ class Const
+ attr_reader :date, :author, :total
+ # Ctor.
+ # +est+:: Estimate
+ def initialize(est)
+ @date = est.date
+ @author = est.author
+ @total = est.total
+ end
end
end
end