From 0f87a27b55e22025dbc6d147ee487f22dc2bb77a Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Fri, 18 Jul 2014 15:37:17 -0400 Subject: [PATCH] Fixing bugs in rangeify, adding todo --- lib/squib/input_helpers.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/squib/input_helpers.rb b/lib/squib/input_helpers.rb index 7a19202..de53419 100644 --- a/lib/squib/input_helpers.rb +++ b/lib/squib/input_helpers.rb @@ -2,10 +2,11 @@ module Squib module InputHelpers def rangeify (range) + raise 'Range cannot be nil' if range.nil? range = 0..(@cards.size-1) if range == :all range = range..range if range.is_a? Integer if range.max > (@cards.size-1) - raise "#{range} is outside of deck range of 0..#{@card.size-1}" + raise "#{range} is outside of deck range of 0..#{@cards.size-1}" end return range end @@ -35,5 +36,9 @@ module Squib end module_function :fontify + def xyify + #TODO: Allow negative numbers that subtract from the card width & height + end + end end \ No newline at end of file