= private = protected
between?(p1, p2)
Returns false if obj <=> min is less than zero or if anObject <=> max is greater than zero, true otherwise.
3.between?(1, 5) #=> true 6.between?(1, 5) #=> false 'cat'.between?('ant', 'dog') #=> true 'gnu'.between?('ant', 'dog') #=> false
/* * call-seq: * obj.between?(min, max) => true or false * * Returns <code>false</code> if <i>obj</i> <code><=></code> * <i>min</i> is less than zero or if <i>anObject</i> <code><=></code> * <i>max</i> is greater than zero, <code>true</code> otherwise. * * 3.between?(1, 5) #=> true * 6.between?(1, 5) #=> false * 'cat'.between?('ant', 'dog') #=> true * 'gnu'.between?('ant', 'dog') #=> false * */ static VALUE cmp_between(x, min, max) VALUE x, min, max; { if (RTEST(cmp_lt(x, min))) return Qfalse; if (RTEST(cmp_gt(x, max))) return Qfalse; return Qtrue; }