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

filter

        # Struct.filter

(from ruby core)
---
    filter(*args)

---

With a block given, returns an array of values from `self` for which the
block returns a truthy value:

    Customer = Struct.new(:name, :address, :zip)
    joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
    a = joe.select {|value| value.is_a?(String) }
    a # => ["Joe Smith", "123 Maple, Anytown NC"]
    a = joe.select {|value| value.is_a?(Integer) }
    a # => [12345]

With no block given, returns an Enumerator.

Struct#filter is an alias for Struct#select.


(This method is an alias for Struct#select.)

With a block given, returns an array of values from `self` for which the
block returns a truthy value:

    Customer = Struct.new(:name, :address, :zip)
    joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
    a = joe.select {|value| value.is_a?(String) }
    a # => ["Joe Smith", "123 Maple, Anytown NC"]
    a = joe.select {|value| value.is_a?(Integer) }
    a # => [12345]

With no block given, returns an Enumerator.

Struct#filter is an alias for Struct#select.



      

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.