RubyWeek 3
HOmeWOrk REviewWalk Through Simon SaysQuestions Should be Answered in ClassGit / Github Review Sheet
Collections
ArrayOrdered ListReferenced by Order(index)
HashKey, Value StoreReferenced by Name(key)
Array and Hash Exercisenumbers = [5,4,7,1,3,2,6]numbers[0]numbers.sizemore_numbers = {“one” => 1, “two” => 2, 3 => “three”...
ModulesSharing BehaviorNamespacingDRY CodeComposition
EnumerableModule for Collection Specific ActionsSearchSortIterate (Enumerate)
Demo Enumerableload ‘monsters.rb’$monstersHow many monsters are nocturnal?What are the names of the monsters that are noct...
Module Exercisenamed_thing.rbVampire’s have namesHuman’s have names
InheritanceParent-ChildSubTypes
Inheritance Exercisemonster.rbMonster   Vampire (vampire.rb)   Zombie   Werewolf
NumbersFixNum1 is always 1! (unlike strings)Floats (BigDecimal)4.23.141516
Ranges1..51...5a..z
HomeWorkReading in questions.txtcalculator_spec.rb
Upcoming SlideShare
Loading in …5
×

Week3

254 views

Published on

UWE-Ruby Fall 2012 week 3

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

  • Be the first to like this

No Downloads
Views
Total views
254
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
2
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
  • Week3

    1. 1. RubyWeek 3
    2. 2. HOmeWOrk REviewWalk Through Simon SaysQuestions Should be Answered in ClassGit / Github Review Sheet
    3. 3. Collections
    4. 4. ArrayOrdered ListReferenced by Order(index)
    5. 5. HashKey, Value StoreReferenced by Name(key)
    6. 6. Array and Hash Exercisenumbers = [5,4,7,1,3,2,6]numbers[0]numbers.sizemore_numbers = {“one” => 1, “two” => 2, 3 => “three”}more_numbers[“one”]
    7. 7. ModulesSharing BehaviorNamespacingDRY CodeComposition
    8. 8. EnumerableModule for Collection Specific ActionsSearchSortIterate (Enumerate)
    9. 9. Demo Enumerableload ‘monsters.rb’$monstersHow many monsters are nocturnal?What are the names of the monsters that are nocturnal?How many legs do all our monsters have?What are the 2 most common dangers and vulnerabilities of our monsters?
    10. 10. Module Exercisenamed_thing.rbVampire’s have namesHuman’s have names
    11. 11. InheritanceParent-ChildSubTypes
    12. 12. Inheritance Exercisemonster.rbMonster Vampire (vampire.rb) Zombie Werewolf
    13. 13. NumbersFixNum1 is always 1! (unlike strings)Floats (BigDecimal)4.23.141516
    14. 14. Ranges1..51...5a..z
    15. 15. HomeWorkReading in questions.txtcalculator_spec.rb

    ×