Sha256: c54aa69a46e311cf539ad4fe86505d6e098195c0c39dec8a2d18d1349f8d29ca

Contents?: true

Size: 913 Bytes

Versions: 8

Compression:

Stored size: 913 Bytes

Contents

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

8 entries across 8 versions & 1 rubygems

Version Path
flight-0.0.23 lib/flight/summarization.rb
flight-0.0.22 lib/flight/summarization.rb
flight-0.0.21 lib/flight/summarization.rb
flight-0.0.20 lib/flight/summarization.rb
flight-0.0.19 lib/flight/summarization.rb
flight-0.0.6 lib/flight/summarization.rb
flight-0.0.5 lib/flight/summarization.rb
flight-0.0.4 lib/flight/summarization.rb