Method: Array#init
- Defined in:
- lib/fr/array.rb
#init(n = 1) ⇒ Array
Selects all elements except the last ‘n` ones.
48 49 50 51 |
# File 'lib/fr/array.rb', line 48 def init(n = 1) raise ArgumentError, "n cannot be negative" if n < 0 slice(0..-(n + 1)) or [] end |