chingu
chingu copied to clipboard
reducing the amount of written code for helpers that delegate methods to other objects
I've made use of Ruby's Forwardable
module to shorten delegate methods to a single line each. Thus:
def add_game_object(object)
@game_objects.add_game_object(object)
end
becomes
def_delegator :@game_objects, :add_game_object
Also extracted the duplicated FPS counter code from Window and Console into a new helper module.