The Making of a Man : Mixins « Language Basics « Ruby






The Making of a Man


class Person
  attr_accessor :name, :age, :gender
end

person_instance = Person.new
person_instance.name = "Robert"
person_instance.age = 52
person_instance.gender = "male"

puts person_instance.name
        

 








Related examples in the same category

1.Creating Mixins
2.Automatically Initializing Mixed-In Modules
3.Simulating Multiple Inheritance with Mixins.rb
4.Mixing in Class Methods.rb