Hi I try to make my first game in ruby :)
I have two files:
#"game.rb" with code: class Game attr_accessor :imie, :klasa, :honor def initialize(start_scena) @start = start_scena end def name() puts "Some text" exit(0) end end and second file
#"game_engine.rb" require_relative 'game.rb' class Start def initialize @game = Game.new(:name) end def play() next_scena = @start while true puts "\n---------" scena = method(next_scena) next_scena = scena.call() end end end go = Start.new() go.play() The question is, how can I call class Game.name method from Start.play() class. The game goes deeper, and insted of 'exit(0)' it returns :symbol of another method from "Game" class that should work.