AITP Ruby And Rails Talk

1,452 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,452
On SlideShare
0
From Embeds
0
Number of Embeds
68
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

AITP Ruby And Rails Talk

  1. 1. Ruby and Rails Jason Dew
  2. 2. Ruby
  3. 3. pure OO
  4. 4. 42.methods.sort
  5. 5. beautiful
  6. 6. def fib n return 0 unless n > 0 return 1 if [1,2].include? n fib(n-1) + fib(n-2) end puts fib(10) # => 55
  7. 7. Symbols
  8. 8. roygbiv = [:red, :orange, :yellow, :green, :blue, :indigo, :violet] some_hash = { :bar => bar, :life => 42 }
  9. 9. blocks
  10. 10. array = [42, bar, [x]] result = array.map do |element| element * 2 end puts result.inspect # => [84, barbar, [x, x]]
  11. 11. classes

×