Created
March 28, 2012 19:50
-
-
Save solomon081/2229933 to your computer and use it in GitHub Desktop.
Ruby Profile
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
require 'ostruct' | |
profile = OpenStruct.new | |
BEGIN {puts "This program generates a profile for you."} | |
END {puts "Name: #{profile.name}" | |
puts "Description: #{profile.desc}" | |
puts "Gender: #{profile.gender}" | |
puts "Age: #{profile.age}" | |
puts "I Live in: #{profile.live}" | |
puts "I was born in: #{profile.born}" | |
puts "I am a: #{profile.religion}" | |
puts "I am interested in: #{profile.sexorient}" | |
puts "My relationship status is: #{profile.rstatus}" | |
} | |
print("Enter in a name: ") | |
gets | |
chomp | |
profile.name = $_ | |
print("Enter in a description of yourself: ") | |
gets | |
chomp | |
profile.desc = $_ | |
print("Enter in your gender: ") | |
gets | |
chomp | |
if $_ == 'Female' or $_ == 'Male' or $_ == 'F' or $_ == 'female' or $_ == 'male' | |
profile.gender = $_ .to_s.capitalize | |
else | |
profile.gender = 'Not Specified' | |
end | |
print("Enter in your age: ") | |
gets | |
chomp | |
profile.age = $_ | |
print("Enter in where you live: ") | |
gets | |
chomp | |
profile.live = $_ | |
print("Enter in where you were born: ") | |
gets | |
chomp | |
profile.born = $_ | |
print("Enter in your religion: ") | |
gets | |
chomp | |
profile.religion = $_ | |
print("Enter in who you are interested in (Men/Women): ") | |
gets | |
chomp | |
profile.sexorient = $_ | |
print("Enter in your relationship status: ") | |
gets | |
chomp | |
profile.rstatus = $_ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment