Sha256: 7d6accd5632e1e2f8d8f01ac44b464f7ec4e3e9e3813f80224a403ea0c62638a

Contents?: true

Size: 782 Bytes

Versions: 5

Compression:

Stored size: 782 Bytes

Contents

module BrighterPlanet
  module Diet
    extend self

    def included(base)
      require 'cohort_scope'
      require 'falls_back_on'
      require 'falls_back_on/active_record_ext'

      require 'diet/carbon_model'
      require 'diet/characterization'
      require 'diet/data'
      require 'diet/summarization'

      base.send :include, BrighterPlanet::Diet::CarbonModel
      base.send :include, BrighterPlanet::Diet::Characterization
      base.send :include, BrighterPlanet::Diet::Data
      base.send :include, BrighterPlanet::Diet::Summarization
    end
    def diet_model
      if Object.const_defined? 'Diet'
        ::Diet
      elsif Object.const_defined? 'DietRecord'
        DietRecord
      else
        raise 'There is no diet model'
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
diet-0.0.9 lib/diet.rb
diet-0.0.8 lib/diet.rb
diet-0.0.7 lib/diet.rb
diet-0.0.6 lib/diet.rb
diet-0.0.5 lib/diet.rb