From 1327bdac582a6b3e26c920588cccddadf64184e9 Mon Sep 17 00:00:00 2001 From: muflax Date: Mon, 30 Apr 2012 00:15:09 +0200 Subject: [PATCH] add ** and % --- lib/range_math.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/range_math.rb b/lib/range_math.rb index d3fe2d5..d48eb95 100644 --- a/lib/range_math.rb +++ b/lib/range_math.rb @@ -20,6 +20,14 @@ class Range pair_or_num :/, other.to_f end + def **(other) + pair_or_num :**, other + end + + def %(other) + pair_or_num :%, other + end + def to_f (self.begin.to_f..self.end.to_f) end