Sha256: 80270d26db44ae77967234866435b9ebfbe30af98ff525f880aacfb9ebb3d8f9

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

Contents

require 'characterizable'

module BrighterPlanet
  module Flight
    module Characterization
      def self.included(base)
        base.send :include, Characterizable
        base.characterize do
          has :aviation_multiplier
          has :distance_estimate, :trumps => :distance_class, :measures => :length, :precision => 0
          has :distance_class
          has :fuel_type
          has :seats_estimate, :range => 1..500
          has :load_factor, :measures => :percentage
          has :trips
          has :seat_class
          has :country
          has :date
          has :origin_airport do |origin_airport|
            origin_airport.reveals :destination_airport, 
              :trumps => [:distance_class, :distance_estimate, :country]
          end
          has :aircraft, :trumps => [:aircraft_class, :seats_estimate, :fuel_type]
          has :aircraft_class, :trumps => :fuel_type
          has :airline
          has :segments_per_trip
        end
        base.add_implicit_characteristics
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
flight-0.1.7 lib/flight/characterization.rb
flight-0.1.6 lib/flight/characterization.rb
flight-0.1.5 lib/flight/characterization.rb
flight-0.1.4 lib/flight/characterization.rb
flight-0.1.3 lib/flight/characterization.rb
flight-0.1.2 lib/flight/characterization.rb
flight-0.1.1 lib/flight/characterization.rb
flight-0.1.0 lib/flight/characterization.rb