Your SlideShare is downloading. ×
Week2
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Week2

190
views

Published on

UWE-Ruby Fall 2012 Week

UWE-Ruby Fall 2012 Week


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

  • Be the first to like this

No Downloads
Views
Total Views
190
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
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
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. RubyWeek 2
    • 2. AgendaHomework Review and SubmissionGit BranchesThe Ruby LanguageRuby Gems (grb)IRB: String objects, String Class,Variables, puts/getsMaking Our Own Objects
    • 3. HomeWork ReviewQuestions.txtstrings_and_rspec_spec.rbSend a Pull Request to UWE-Ruby/RubyFall2012
    • 4. Git ReviewGitHubforks and repos (remote & local)branches (DeMo!)
    • 5. Rspec ReviewCode that Tests Code!!Describe a feature, set anexpectation.Red-Green-Refactor
    • 6. RubyEverything is an Object!Type Doesn’t matter! (respond_to?)Speaking Ruby : Interpreter Needed! MRI, YARV, JRuby
    • 7. Ruby GemsPackaged Ruby CodeOpen SourceiPhone user: “There’s an app for that!”Ruby programer: “There’s a gem for that!”
    • 8. GRBGit Remote BranchRuby Gem to help with git!Combines remote branch steps intoone!DeMo!
    • 9. IRBInteractive Ruby!Our Ruby Interpreter!We speak ruby, it translates!Understand Ruby code, evaluates it,gives us the result (inspect)
    • 10. RubyEverything evaluates to somethingnil is NULL or nothing or Not SetEvery Object respond_to? inspect => true
    • 11. ObjectsRuby: everything is an object Everything is an instance of a classRuby knows about certain classes ofthings: Standard Library
    • 12. StringString class : part of the standardlibraryHow Ruby understands textInstances String.new or ‘’ or “” or Q%[] or q%[]
    • 13. String Classhttp://www.ruby-doc.org/core-1.9.3/String.htmlMethods : Messages we can send, whatan instance will respond toChomp, *, +, include?, upcase
    • 14. VariablesNamed locationPoints to somethingContents Can Change
    • 15. String Interpolation my_name = “Renée” “Hello #{my_name}”
    • 16. puts / getsput stringget stringputs “Hello World”user_input = getsuser_input = gets.chomp
    • 17. Mad-Libs!noun = gets.chompadjective = gets.chompverb_past_tense = gets.chomp“The #{adjective} #{noun}#{verb_past_tense} past thegraveyard”
    • 18. Ruby Scriptsmad_libs.rbruby mad_libs.rb
    • 19. Making ObjectsTell Ruby About Something New!A new class of stuff!
    • 20. What is a BookAll Books have....??
    • 21. Defining New Classes Initialize attributes / readers and writers Scope Instance variables Instance methods
    • 22. HomeworkReading and Simon Says Spec