lib/rail_trip/summarization.rb in rail_trip-0.0.13 vs lib/rail_trip/summarization.rb in rail_trip-0.0.14
- old
+ new
@@ -18,10 +18,10 @@
##### The carbon model
# This `summarize` block encapsulates the summarization strategy, including
# terminology and inflection preference.
base.summarize do |has|
- has.adjective lambda { |rail_trip| "#{rail_trip.distance_in_miles.adaptive_round(1)}-mile" }, :if => :distance
+ has.adjective lambda { |rail_trip| "#{rail_trip.distance.convert(:kilometres, :miles).round(1)}-mile" }, :if => :distance
has.adjective lambda { |rail_trip| "#{rail_trip.duration}-hour" }, :if => :duration
has.identity 'rail trip'
has.verb :take
has.aspect :perfect
end