Created
January 22, 2015 02:02
-
-
Save aguayma/9fe252a76a9aa6ac1ed9 to your computer and use it in GitHub Desktop.
This file contains 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
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