Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/powerpack/array/butlast.rb,
lib/powerpack/array/butfirst.rb
Instance Method Summary collapse
-
#butfirst ⇒ Array
Returns a new array rejecting the current one’s first element.
-
#butlast ⇒ Array
Returns a new array that has all the elements of the current but the last.
Instance Method Details
#butfirst ⇒ Array
Returns a new array rejecting the current one’s first element.
11 12 13 |
# File 'lib/powerpack/array/butfirst.rb', line 11 def butfirst self[1..-1] end |
#butlast ⇒ Array
Returns a new array that has all the elements of the current but the last.
11 12 13 |
# File 'lib/powerpack/array/butlast.rb', line 11 def butlast self[0...-1] end |