picardo picardo - 1 year ago 64
Ruby Question

How to use present? in Ruby projects?

I wrote a script that uses Rails' extensions to the Ruby core Object class, and now I want to spin it off on its own. Rather than rewriting these, is there any library or extension that I can use to make them available independently?

Answer Source

You don't have to run Rails to use

require 'active_support/all'

or if you just want a specific extension, like blank? for string then just

require 'active_support/core_ext/string'

I looked up present? and it's actually defined as

def present?
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download