This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.
# Array.max (from ruby core) --- array.max -> element array.max {|a, b| ... } -> element array.max(n) -> new_array array.max(n) {|a, b| ... } -> new_array --- Returns one of the following: * The maximum-valued element from `self`. * A new Array of maximum-valued elements selected from `self`. When no block is given, each element in `self` must respond to method `<=>` with an Integer. With no argument and no block, returns the element in `self` having the maximum value per method `<=>`: [0, 1, 2].max # => 2 With an argument Integer `n` and no block, returns a new Array with at most `n` elements, in descending order per method `<=>`: [0, 1, 2, 3].max(3) # => [3, 2, 1] [0, 1, 2, 3].max(6) # => [3, 2, 1, 0] When a block is given, the block must return an Integer. With a block and no argument, calls the block `self.size-1` times to compare elements; returns the element having the maximum value per the block: ['0', '00', '000'].max {|a, b| a.size <=> b.size } # => "000" With an argument `n` and a block, returns a new Array with at most `n` elements, in descending order per the block: ['0', '00', '000'].max(2) {|a, b| a.size <=> b.size } # => ["000", "00"]
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.