Skip to content

Instantly share code, notes, and snippets.

View justuseapen's full-sized avatar

Justus Eapen justuseapen

View GitHub Profile
class Car
def initialize(color, owner, cylinders)
@color = color
@owner = owner
@cylinders = cylinders
end
def color
@color
end
class Television
def initialize(size,brand)
@size = size
@brand = brand
end
end
class TVChannel
def initialize(name,channel_number,parent_company)
@name = name
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}"
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"
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"
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"
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"
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}"
puts "What would you like to say?"
phrase = gets.chomp
def playback(phrase)
puts "You said: #{phrase}"
end
playback(phrase)
require 'pry'
require 'csv'
def prompt(query)
puts query
gets.chomp
end
def get_data
item = prompt "What is the name of the item?"