lib/slot_machine/slot.rb in slot_machine-0.1.1 vs lib/slot_machine/slot.rb in slot_machine-0.1.2

- old
+ new

@@ -152,21 +152,21 @@ raise ArgumentError, "Passed value is invalid (#{value} given)" unless valid?(value) value end def match_compared(a, b, interval) - if a.is_a?(Array) && b.is_a?(Fixnum) + if a.is_a?(Array) && b.is_a?(Integer) raise ArgumentError, "Length has to be greater than 0 (#{b} given)" unless b > 0 i = 0 [].tap do |matches| while (a.size / b) > 0 matches << from_array(a[0, b]) a.shift interval i += interval end end - elsif a.is_a?(Fixnum) && b.is_a?(Array) + elsif a.is_a?(Integer) && b.is_a?(Array) match_compared b, a, interval elsif a.is_a?(Array) && b.is_a?(Array) [].tap do |matches| unless (array = a & b).empty? matches << from_array(array) @@ -176,6 +176,6 @@ raise ArgumentError, "Cannot match when passing two length slots" end end end -end \ No newline at end of file +end