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.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/way_cost.rb b/lib/way_cost.rb
new file mode 100644
index 000000000..9f860308c
--- /dev/null
+++ b/lib/way_cost.rb
@@ -0,0 +1,27 @@
+class WayCost
+ attr_reader :departure, :arrival, :id
+ attr_accessor :distance, :time
+
+ def initialize(
+ departure:,
+ arrival:,
+ distance: nil,
+ time: nil,
+ id: nil
+ )
+ @departure = departure
+ @arrival = arrival
+ @distance = distance
+ @time = time
+ @id = id
+ end
+
+ def ==(other)
+ other.is_a?(self.class) &&
+ @departure == other.departure &&
+ @arrival == other.arrival &&
+ @distance == other.distance &&
+ @time == other.time &&
+ @id == other.id
+ end
+end