Skip to content

Instantly share code, notes, and snippets.

@aguayma
Created January 22, 2015 02:02
Show Gist options
  • Save aguayma/9fe252a76a9aa6ac1ed9 to your computer and use it in GitHub Desktop.
Save aguayma/9fe252a76a9aa6ac1ed9 to your computer and use it in GitHub Desktop.
voter_arr = []
politician_arr = []
class Hummus
def initialize(name,party)
@name = name
@party = party
end
end
class Politician < Hummus
end
class Person < Hummus
end
def create
puts "Please enter a name."
name = gets.chomp
puts "Please enter a party."
party = gets.chomp
def person_type
puts "Please enter a type."
until gets.chomp == "politician" || gets.chomp == "voter"
type = gets.chomp
case type
when "politician"
politician_arr.push(politician.new(name,party))
when "voter"
voter_arr.push(politician.new(name,party))
else
puts ""
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment