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

Week2

397 views

Published on

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
397
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

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
  • Week2

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

    ×