Module: BrighterPlanet::RailTrip::Data

Defined in:
lib/rail_trip/data.rb

Overview

Rail trip: persistence schema This module is used by [Brighter Planet](brighterplanet.com)‘s [emission estimate service](carbon.brighterplanet.com) to provide a persistence structure, which is in turn used by the [characterization](characterization.html).

For more information see:

* [API documentation](http://carbon.brighterplanet.com/rail_trips/options)
* [Source code](http://github.com/brighterplanet/rail_trip)

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/rail_trip/data.rb', line 17

def self.included(base)
  ##### The carbon model
  base.data_miner do
    # This `schema` block encapsulates the persistence schema.
    schema do
      string  'rail_class_name'
      float   'duration'
      float   'distance'
      date    'date'
    end

    # This `process` block indicates that RailTrip's associated classes
    # should populate themselves according to their own DataMiner
    # instructions.
    process :run_data_miner_on_belongs_to_associations
  end
end