Module: BrighterPlanet::RailTrip::Characterization

Defined in:
lib/rail_trip/characterization.rb

Overview

Rail trip: characterization This module is used by [Brighter Planet](brighterplanet.com)‘s [emission estimate service](carbon.brighterplanet.com) to provide curated attributes for the carbon model execution environment.

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
# File 'lib/rail_trip/characterization.rb', line 17

def self.included(base)
  ##### The characterization

  # This `characterize` block encapsulates the characterization. Typically
  # emitter models will be backed by ActiveRecord, which will provide
  # these attributes accessors based on database schema. The characteristics
  # listed here define the standard public API to RailTrip.
  base.characterize do
    has :rail_class
    has :duration, :measures => :time
    has :distance, :measures => :length
    has :date
  end
  
  # Additional characteristics are gleaned from the carbon model.
end