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 Car | |
def initialize(color, owner, cylinders) | |
@color = color | |
@owner = owner | |
@cylinders = cylinders | |
end | |
def color | |
@color | |
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 Television | |
def initialize(size,brand) | |
@size = size | |
@brand = brand | |
end | |
end | |
class TVChannel | |
def initialize(name,channel_number,parent_company) | |
@name = name |
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 = nil, suit = nil) | |
if suit.nil? | |
@suit = ['♠', '♣', '♥', '♦'].sample | |
else | |
@suit = suit | |
end | |
if rank.nil? | |
@rank = [2..10,'J','Q','K','A'].sample | |
puts "Create a new card: #{@rank} of #{@suit}" |
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
puts "What would you like to say?" | |
phrase = gets.chomp | |
def lots_to_say | |
phrases = [] | |
puts "Ok, let's hear it!" | |
input = "" | |
while input != "done" | |
input = gets.chomp | |
if input == "done" |
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
puts "What would you like to say?" | |
phrase = gets.chomp | |
def lots_to_say | |
phrases = [] | |
puts "Ok, let's hear it!" | |
input = "" | |
while input != "done" | |
input = gets.chomp | |
if input == "done" |
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
puts "What would you like to say?" | |
phrase = gets.chomp | |
def lots_to_say | |
phrases = [] | |
puts "Ok, let's hear it!" | |
input = "" | |
while input != "done" | |
input = gets.chomp | |
if input == "done" |
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
puts "What would you like to say?" | |
phrase = gets.chomp | |
def lots_to_say | |
phrases = [] | |
puts "Ok, let's hear it!" | |
input = "" | |
while input != "done" | |
input = gets.chomp | |
if input == "done" |
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
puts "What would you like to say?" | |
phrase = gets.chomp | |
def playback(phrase) | |
if phrase == "Nothing!" | |
puts "OK, fine!" | |
elsif phrase == "I have a lot to say." | |
puts "Ain't nobody got time for that!" | |
else | |
puts "You said: #{phrase}" |
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
puts "What would you like to say?" | |
phrase = gets.chomp | |
def playback(phrase) | |
puts "You said: #{phrase}" | |
end | |
playback(phrase) |
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' | |
require 'csv' | |
def prompt(query) | |
puts query | |
gets.chomp | |
end | |
def get_data | |
item = prompt "What is the name of the item?" |