aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-05-24 12:04:02 +0200
committerTeddy Wing2017-05-26 13:20:56 +0200
commitbbfdc698cdaaa92ca6842fb566a9ace17ddd558a (patch)
tree1136f2872761360ceaaa5956fd423dc518921a74
parentc9c550f429ebcffc01473019ba7c941137c37974 (diff)
downloadchouette-core-bbfdc698cdaaa92ca6842fb566a9ace17ddd558a.tar.bz2
TimeDuration: Add a method comment above `.exceeds_gap?`
Describe what's going on here to hopefully make it easier to understand. Refs #870
-rw-r--r--lib/time_duration.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/time_duration.rb b/lib/time_duration.rb
index 4d12654c2..f64c81bdd 100644
--- a/lib/time_duration.rb
+++ b/lib/time_duration.rb
@@ -1,4 +1,13 @@
module TimeDuration
+ # `earlier` and `later` are times. Get the duration between those times and
+ # check whether it's longer than the given `duration`.
+ #
+ # Example:
+ # TimeDuration.exceeds_gap?(
+ # 4.hours,
+ # Time.now,
+ # Time.now + 2.hours
+ # )
def self.exceeds_gap?(duration, earlier, later)
duration < (later - earlier)
end