Skip to content

Commit 00f1df4

Browse files
authored
Merge pull request #84 from jzakiya/master
Add val.between?(start, end) to range comparisons
2 parents e7dcbe8 + 4af2bc5 commit 00f1df4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

code/range/cover-vs-include.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
x.report('range#include?') { (BEGIN_OF_JULY..END_OF_JULY).include? DAY_IN_JULY }
1111
x.report('range#member?') { (BEGIN_OF_JULY..END_OF_JULY).member? DAY_IN_JULY }
1212
x.report('plain compare') { BEGIN_OF_JULY < DAY_IN_JULY && DAY_IN_JULY < END_OF_JULY }
13-
13+
x.report('value.between?') { DAY_IN_JULY.between?(BEGIN_OF_JULY, END_OF_JULY) }
14+
1415
x.compare!
1516
end

0 commit comments

Comments
 (0)