Method: Array#suffix
- Defined in:
- lib/snmputils/arrayutils.rb
#suffix ⇒ Object
Calculate the longest common suffix for all elements in the array.
Requires array elements to support size and take operations
46 47 48 49 |
# File 'lib/snmputils/arrayutils.rb', line 46 def suffix prefix = (map { |x| x != nil && x.reverse }).prefix prefix.reverse if prefix end |