This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.
# Range.last (from ruby core) --- last -> object last(n) -> array --- With no argument, returns the last element of `self`, if it exists: (1..4).last # => 4 ('a'..'d').last # => "d" Note that `last` with no argument returns the end element of `self` even if #exclude_end? is `true`: (1...4).last # => 4 ('a'...'d').last # => "d" With non-negative integer argument `n` given, returns the last `n` elements in an array: (1..10).last(3) # => [8, 9, 10] (1..10).last(0) # => [] (1..4).last(50) # => [1, 2, 3, 4] Note that `last` with argument does not return the end element of `self` if #exclude_end? it `true`: (1...4).last(3) # => [1, 2, 3] ('a'...'d').last(3) # => ["a", "b", "c"] Raises an exception if there is no last element: (1..).last # Raises RangeError
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.