This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'pry' | |
| class Car | |
| class Make < Car | |
| @@makes = [] | |
| def self.add_make(make) | |
| @@makes << make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Animal | |
| def emote | |
| puts "#{name} #{sound}ed annoyingly" | |
| end | |
| def eat | |
| puts "#{name} ate #{sustenance}." | |
| end | |
| end | |
| class Duck < Animal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name | grade | |
|---|---|---|
| John Smith | 75 | |
| Sally Field | 85 | |
| Jane Doe | 93 | |
| Gus Grumpy | 98 | |
| Mark Marcus | 68 | |
| Vic Victor | 83 | |
| Frank Furter | 89 | |
| John Bello | 78 | |
| Liz Branch | 99 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AssignmentGrade | |
| def initialize (score) | |
| @score = score.to_i | |
| end | |
| def score | |
| @score | |
| end | |
| def all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Circle | |
| def initialize(radius) | |
| @radius = radius | |
| end | |
| def diameter | |
| @diameter = @radius * 2 | |
| end | |
| def circumference | |
| Math::PI*@diameter | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Implement your solution here. You may reference any additional files from here as well. | |
| @results = [] | |
| def team_names_and_scores | |
| puts "What was team one's name?" | |
| team1 = gets.chomp | |
| puts "What was team one's score?" | |
| team1_score = gets.chomp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Implement your solution here. You may reference any additional files from here as well. | |
| @results = [] | |
| def team_names_and_scores | |
| puts "What was team one's name?" | |
| team1 = gets.chomp | |
| puts "What was team one's score?" | |
| team1_score = gets.chomp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Whiteboard | |
| attr_accessor :contents | |
| def initialize(contents = []) | |
| @contents = contents | |
| end | |
| def wipe_board | |
| @contents = [] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Whiteboard | |
| attr_accessor :contents | |
| def initialize(contents = []) | |
| @contents = contents | |
| end | |
| def wipe_board | |
| @contents = [] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Card | |
| def initialize(rank, suit) | |
| @suit = suit | |
| @rank = rank | |
| end | |
| def rank | |
| @rank | |
| end | |