aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/way_cost.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/way_cost.rb b/lib/way_cost.rb
index 9f860308c..53e69ddb3 100644
--- a/lib/way_cost.rb
+++ b/lib/way_cost.rb
@@ -24,4 +24,12 @@ class WayCost
@time == other.time &&
@id == other.id
end
+
+ def cache_key
+ raise NullIDError if !id
+
+ "way_cost/#{id}"
+ end
+
+ class NullIDError < RuntimeError; end
end