Open bazz1tv opened 8 years ago
Here's an example of how that could be done.
class A def initialize(owner) @owner = owner end def owner_name @owner.class.name.split("::").last end def do_stuff puts owner_name end end class B def initialize @a = A.new(self) end def do_stuff @a.do_stuff end end b = B.new b.do_stuff
Needs a refactor now.
so you'll see highscores.inc_highscore(user) which could probably just be highscores.inc(user)
highscores.inc_highscore(user)
highscores.inc(user)
actually, what about making it more OO, like:
user.score.inc
Here's an example of how that could be done.