Permalink
Browse files

Minor refactor - Uses Enumerable#to_a instead of iterate and add to an

array
  • Loading branch information...
phstc committed Jul 27, 2013
1 parent 4236d8f commit 7ed8934f089dba8cbb90a98920cd4242ba5e0fd3
@@ -31,9 +31,7 @@ def in_groups_of(number, fill_with = nil)
if block_given?
collection.each_slice(number) { |slice| yield(slice) }
else
- groups = []
- collection.each_slice(number) { |group| groups << group }
- groups
+ collection.each_slice(number).to_a
end
end
@@ -119,7 +119,7 @@ def change(options)
options.fetch(:day, day)
)
end
-
+
# Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there.
def compare_with_coercion(other)
if other.is_a?(Time)
@@ -235,7 +235,6 @@ def process_array(value)
value.map! { |i| deep_to_h(i) }
value.length > 1 ? value : value.first
end
-
end
end

0 comments on commit 7ed8934

Please sign in to comment.