Ruby: How to make a public static method?

Your given example is working very well

class Ask
  def self.make_permalink(phrase)
    phrase.strip.downcase.gsub! /\ +/, '-'

Ask.make_permalink("make a slug out of this line")

I tried in 1.8.7 and also in 1.9.3
Do you have a typo in you original script?

All the best

Leave a Comment