Method: Lotus::Utils::Kernel.Array
- Defined in:
- lib/lotus/utils/kernel.rb
.Array(arg) ⇒ Array
Coerces the argument to be an Array.
It’s similar to Ruby’s Kernel.Array, but it applies further transformations:
* flatten
* compact
* uniq
81 82 83 84 85 86 87 |
# File 'lib/lotus/utils/kernel.rb', line 81 def self.Array(arg) super(arg).dup.tap do |a| a.flatten! a.compact! a.uniq! end end |