Sha256: 192a3c7e0502bf2c053a6660598f57e078c2d2ef999a4fed258910594e61d297
Contents?: true
Size: 942 Bytes
Versions: 3
Compression:
Stored size: 942 Bytes
Contents
require 'summary_judgement' module BrighterPlanet module Flight module Summarization def self.included(base) base.summarize do |has| has.adjective 'one-way', :if => lambda { |flight| flight.trips == 1 } has.adjective 'round-trip', :if => lambda { |flight| flight.trips == 1 } has.adjective 'nonstop', :if => lambda { |flight| flight.emplanements_per_trip == 1 } has.identity 'flight' has.modifier lambda { |flight| "from #{flight.origin_airport.name}" }, :if => :origin_airport has.modifier lambda { |flight| "to #{flight.destination_airport.name}" }, :if => :destination_airport has.modifier lambda { |flight| "on a #{flight.vehicle}" }, :if => :vehicle has.modifier lambda { |flight| "on #{flight.date.to_formatted_s(:archive)}"}, :if => :date has.verb :take has.aspect :perfect end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
flight-0.0.9 | lib/flight/summarization.rb |
flight-0.0.8 | lib/flight/summarization.rb |
flight-0.0.7 | lib/flight/summarization.rb |