Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement