aboutsummaryrefslogtreecommitdiffstats
path: root/lib/way_cost.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/way_cost.rb')
-rw-r--r--lib/way_cost.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/way_cost.rb b/lib/way_cost.rb
index 027d8f593..5de64177f 100644
--- a/lib/way_cost.rb
+++ b/lib/way_cost.rb
@@ -1,6 +1,6 @@
class WayCost
attr_reader :departure, :arrival
- attr_writer :distance, :time
+ attr_accessor :distance, :time
def initialize(
departure:,
@@ -15,4 +15,12 @@ class WayCost
@time = time
@id = id
end
+
+ def ==(other)
+ other.is_a?(self.class) &&
+ @departure == other.departure &&
+ @arrival == other.arrival &&
+ @distance == other.distance &&
+ @time == other.time
+ end
end