4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/automobile/characterization.rb', line 4
def self.included(base)
base.characterize do
has :make do |make|
make.reveals :model_year do |model_year|
model_year.reveals :model, :trumps => :size_class do |model|
model.reveals :variant, :trumps => :hybridity
end
end
end
has :fuel_type
has :fuel_efficiency, :trumps => [:urbanity, :hybridity], :measures => :length_per_volume
has :urbanity, :measures => :percentage
has :hybridity
has :daily_distance_estimate, :trumps => [:weekly_distance_estimate, :annual_distance_estimate, :daily_duration], :measures => :length has :daily_duration, :trumps => [:annual_distance_estimate, :weekly_distance_estimate, :daily_distance_estimate], :measures => :time has :weekly_distance_estimate, :trumps => [:annual_distance_estimate, :daily_distance_estimate, :daily_duration], :measures => :length has :annual_distance_estimate, :trumps => [:weekly_distance_estimate, :daily_distance_estimate, :daily_duration], :measures => :length has :acquisition
has :retirement
has :size_class
end
end
|