Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlyobvious committed Oct 10, 2023
1 parent d43be65 commit ef9a99e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/booking/day_schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(allowed_time_range)

def reserve(time_range)
cannot_reserve unless allowed_time_range.cover?(time_range)
cannot_reserve if reserved_slots.any?(covers?(time_range))
cannot_reserve if reserved_slots.any?(cover?(time_range))
reserved_slots << time_range
visit_scheduled(time_range)
end
Expand All @@ -27,7 +27,7 @@ def visit_scheduled(time_range)
)
end

def covers?(time_range)
def cover?(time_range)
->(slot) { slot.cover?(time_range.first) || slot.cover?(time_range.last) }
end

Expand Down

0 comments on commit ef9a99e

Please sign in to comment.