Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Person
- def initialize
- @name = "Newborn"
- @age = 1
- end
- def name
- @name
- end
- def age
- @age
- end
- end
- class Dekita < Person
- def initialize
- @name = "Dekita"
- @age = 24
- end
- end
- class Dekita
- alias :init_alias :initialize
- def initialize
- init_alias
- @gender = "??"
- end
- def gender
- @gender
- end
- end
- dekita = Dekita.new
- p dekita.name
- p dekita.age
- p dekita.gender
- module Person_New
- def new_stuff
- return "New Stuff"
- end
- end
- class Person
- include Person_New
- end
- p dekita.new_stuff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement