Sha256: 968e174445570b3c43fca1a8a668da0db96baa33bdca42a2f6955a7a792fef47

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

require 'characterizable'

module BrighterPlanet
  module Diet
    module Characterization
      def self.included(base)
        base.send :include, Characterizable
        base.characterize do
          has :diet_class
          has :red_meat_share, :trumps => :diet_class
          has :poultry_share, :trumps => :diet_class
          has :fish_share, :trumps => :diet_class
          has :eggs_share, :trumps => :diet_class
          has :nuts_share, :trumps => :diet_class
          has :dairy_share, :trumps => :diet_class
          has :cereals_and_grains_share, :trumps => :diet_class
          has :fruit_share, :trumps => :diet_class
          has :vegetables_share, :trumps => :diet_class
          has :oils_and_sugars_share, :trumps => :diet_class
          has :size # TODO more standard unit?
          has :proximity, :measures => :percentage # impotent for now
          has :conventionality, :measures => :percentage # impotent for now
          has :start_date do |start_date|
            start_date.reveals :end_date
          end
        end
        base.add_implicit_characteristics
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
diet-0.0.13 lib/diet/characterization.rb
diet-0.0.12 lib/diet/characterization.rb
diet-0.0.11 lib/diet/characterization.rb