Skip to content

Instantly share code, notes, and snippets.

@diffused
Last active November 27, 2015 08:05
Show Gist options
  • Save diffused/f1658a616869d5558d62 to your computer and use it in GitHub Desktop.
Save diffused/f1658a616869d5558d62 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'date'
class Girl
def initialize(name, date_of_birth, weight_in_kg)
@name = name
@date_of_birth = date_of_birth
@weight_in_kg = weight_in_kg
end
def hello
puts "Hello World! My name is #{@name}. I was born on #{@date_of_birth} and weigh #{@weight_in_kg} kg."
end
end
baby_ruby = Girl.new("Ruby Faye Hawkins", Date.new(2015, 11, 26), 2.72)
baby_ruby.hello()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment