This is a simple one, I hope. How do I check, in the following example, if a constant is already defined?
#this works var = var||1 puts var var = var||2 put
const_defined? API
pry> User.const_defined?("PER_PAGE") => true pry> User.const_defined?("PER_PAGE123") => false