Skip to content

Instantly share code, notes, and snippets.

@fresh5447
Created February 19, 2014 21:33
Show Gist options
  • Save fresh5447/9102099 to your computer and use it in GitHub Desktop.
Save fresh5447/9102099 to your computer and use it in GitHub Desktop.
class User
attr_accessor :name, :email, :bio, :age, :sex
def initialize(config = {})
@name = config[:name] || "n/a"
@email = config[:email] || "n/a"
@bio = config[:bio] || "n/a"
@age = config[:age] || "n/a"
@sex = config[:sex] || "n/a"
end
end
u = User.new(name: "Bob")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment