May 2, 2015 by Daniel P. Clark

Private Module Methods in Ruby

So this is something I’ve looked into many times over the years and have never found an answer to.  But great news is that I’ve found a way! It’s as simple as defining module methods as private within the singleton class.  Here’s how I did it in my gem PolyBelongsTo

My gem gets included…

Continue Reading »

March 6, 2015 by Daniel P. Clark

Numeric Bases and Defining Your Own

Lately I’ve been teaching my niece a new way to do math.  She would have difficulty with addition and subtraction of numbers if they contained more than a few digits.  I asked her if she’d ever seen a clock where the numbers rolled over (like in the movie Ground Hog Day).  She hadn’t.  I decided…

Continue Reading »