rail_trip 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@ module BrighterPlanet
|
|
20
20
|
# This `summarize` block encapsulates the summarization strategy, including
|
21
21
|
# terminology and inflection preference.
|
22
22
|
base.summarize do |has|
|
23
|
-
has.adjective lambda { |rail_trip| "#{rail_trip.
|
23
|
+
has.adjective lambda { |rail_trip| "#{rail_trip.distance.convert(:kilometres, :miles).round(1)}-mile" }, :if => :distance
|
24
24
|
has.adjective lambda { |rail_trip| "#{rail_trip.duration}-hour" }, :if => :duration
|
25
25
|
has.identity 'rail trip'
|
26
26
|
has.verb :take
|
data/lib/rail_trip.rb
CHANGED
@@ -3,15 +3,5 @@ require 'emitter'
|
|
3
3
|
module BrighterPlanet
|
4
4
|
module RailTrip
|
5
5
|
extend BrighterPlanet::Emitter
|
6
|
-
|
7
|
-
def self.rail_trip_model
|
8
|
-
if Object.const_defined? 'RailTrip'
|
9
|
-
::RailTrip
|
10
|
-
elsif Object.const_defined? 'RailTripRecord'
|
11
|
-
RailTripRecord
|
12
|
-
else
|
13
|
-
raise 'There is no rail_trip model'
|
14
|
-
end
|
15
|
-
end
|
16
6
|
end
|
17
7
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rail_trip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 14
|
10
|
+
version: 0.0.14
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andy Rossmeissl
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2010-12-
|
22
|
+
date: 2010-12-07 00:00:00 -06:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
@@ -171,6 +171,8 @@ files:
|
|
171
171
|
- lib/rail_trip/carbon_model.rb
|
172
172
|
- lib/rail_trip/characterization.rb
|
173
173
|
- lib/rail_trip/data.rb
|
174
|
+
- lib/rail_trip/fallback.rb
|
175
|
+
- lib/rail_trip/relationships.rb
|
174
176
|
- lib/rail_trip/summarization.rb
|
175
177
|
- lib/test_support/rail_trip_record.rb
|
176
178
|
- features/support/env.rb
|