Class: Array
Instance Method Summary collapse
-
#_flatten_once ⇒ Object
Only flatten the first level of an array.
- #_sum ⇒ Object
Instance Method Details
#_flatten_once ⇒ Object
Only flatten the first level of an array
4 5 6 7 8 |
# File 'lib/ultrasphinx/core_extensions.rb', line 4 def _flatten_once self.inject([]) do |set, element| set + Array(element) end end |
#_sum ⇒ Object
10 11 12 13 14 |
# File 'lib/ultrasphinx/core_extensions.rb', line 10 def _sum self.inject(0) do |acc, element| acc + element end end |