This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

delete

        # Array.delete

(from ruby core)
---
    array.delete(obj) -> deleted_object
    array.delete(obj) {|nosuch| ... } -> deleted_object or block_return

---

Removes zero or more elements from `self`; returns `self`.

When no block is given, removes from `self` each element `ele` such that
`ele == obj`; returns the last deleted element:
    s1 = 'bar'; s2 = 'bar'
    a = [:foo, s1, 2, s2]
    a.delete('bar') # => "bar"
    a # => [:foo, 2]

Returns `nil` if no elements removed.

When a block is given, removes from `self` each element `ele` such that
`ele == obj`.

If any such elements are found, ignores the block and returns the last
deleted element:
    s1 = 'bar'; s2 = 'bar'
    a = [:foo, s1, 2, s2]
    deleted_obj = a.delete('bar') {|obj| fail 'Cannot happen' }
    a # => [:foo, 2]

If no such elements are found, returns the block's return value:
    a = [:foo, 'bar', 2]
    a.delete(:nosuch) {|obj| "#{obj} not found" } # => "nosuch not found"



      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.