A collection of utilities for working with Arrays.
Return a version of the given array
with any Symbols contained
in it turned into Strings.
# File lib/treequel/mixins.rb, line 257
def stringify_array( array )
return array.collect do |item|
case item
when Symbol
item.to_s
when Array
stringify_array( item )
else
item
end
end
end
Return a version of the given array
with any Strings contained
in it turned into Symbols.
# File lib/treequel/mixins.rb, line 273
def symbolify_array( array )
return array.collect do |item|
case item
when String
item.to_sym
when Array
symbolify_array( item )
else
item
end
end
end