Your SlideShare is downloading. ×
0
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Introduction to ruby
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Introduction to ruby

557

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
557
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
24
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Introduction to Ruby Andrew Liu
  • 2. Ruby is…• Designed by Yukihiro Matsumoto (松本行弘) – "I wanted a scripting language that was more powerful than Perl, and more object- oriented than Python. Thats why I decided to design my own language“• An object-oriented scripting language• Easy to learn!
  • 3. Philosophy• Often people, especially computer engineers, focus on the machines. They think, "By doing this, the machine will run faster. By doing this, the machine will run more effectively. By doing this, the machine will something something something."• They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves.
  • 4. Naming Convention• CamelCase – Class names, module names• ALLCAPITAL – Constants• words_with_underscore – Method names, variable names• $ prefix – Global variables
  • 5. Everything is an object!
  • 6. Strings
  • 7. String Methods
  • 8. Array
  • 9. What if I want to reverse the array? http://ruby-doc.org/core/
  • 10. Range
  • 11. Hash
  • 12. Block
  • 13. How does it work?
  • 14. More About Class
  • 15. More About Class
  • 16. Class• Variable – @@ prefix: Shared by all class instances – @ prefix: Contains instances information – No prefix: normal variables• Methods – self. Prefix: Class methods, as known as static method – No prefix: Instance methods, must be called with a instance
  • 17. Creating Instance
  • 18. Flow Control
  • 19. Cases
  • 20. While
  • 21. For
  • 22. Resources• Programming Ruby (Bible) – http://www.ruby- doc.org/docs/ProgrammingRuby/• Ruby API Document – http://ruby-doc.org/core/• TryRuby – http://tryruby.org/• Ruby Warrior – https://github.com/ryanb/ruby-warrior

×