var.split('/').delete_at(0)
upon inspection returns
""
no matter what the string, however….
var.split('/')
var.delete_at(0)
gives me no trouble. this is probably a stupid question, but are there some sort of restrictions/limitations regarding method chaining like this?
thanks,
brandon
The delete_at method deletes the element but returns the deleted element not the new array.
If you want to always return the object, you can use the tap method (available since Ruby 1.8.7).