Relative Content

Tag Archive for rubyoop

How to extend an object in Ruby?

Say, I have an object that replies to .hello method. Now, I want to create another object that will reply to both hello (and all other methods of the original object) and bye methods. Something like this:

Ruby OOP: What causes NameError in Game Object?

I am learning OOP with Ruby. I have 2 classes – Game & Player.
Player and Computer are to be created for Tick-Tack-Toe game. My idea is to use Player class to create a player and a computer for the game.