mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Use kind_of? instead of class.include? and rearrange stuff
This commit is contained in:
@@ -101,10 +101,10 @@ module Liquid
|
|||||||
def map(input, property)
|
def map(input, property)
|
||||||
ary = if input.is_a?(Array)
|
ary = if input.is_a?(Array)
|
||||||
input.flatten
|
input.flatten
|
||||||
elsif !input.class.include?(Enumerable)
|
elsif input.kind_of?(Enumerable)
|
||||||
[input].flatten
|
|
||||||
else
|
|
||||||
input
|
input
|
||||||
|
else
|
||||||
|
[input].flatten
|
||||||
end
|
end
|
||||||
|
|
||||||
ary.map do |e|
|
ary.map do |e|
|
||||||
|
|||||||
Reference in New Issue
Block a user