提交 7ed8934f 编写于 作者: P Pablo Cantero

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

array
上级 4236d8f0
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册