Skip to content

Instantly share code, notes, and snippets.

@fenixbrassi
Created December 18, 2013 01:02
Show Gist options
  • Save fenixbrassi/8015638 to your computer and use it in GitHub Desktop.
Save fenixbrassi/8015638 to your computer and use it in GitHub Desktop.
Enumerable functions
irb(main):054:0> [].any?
=> false
irb(main):055:0> [2].any?
=> true
irb(main):058:0> [2,2,3,4,5,6,7].count
=> 7
irb(main):061:0> [2,2,3,4,5,6,7].drop(1)
=> [2, 3, 4, 5, 6, 7]
irb(main):062:0> [2,2,3,4,5,6,7].drop(4)
=> [5, 6, 7]
irb(main):063:0> [2,2,3,4,5,6,7].min
=> 2
irb(main):065:0> [2,2,3,4,5,6,7].max
=> 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment