Sha256: 0611db34d27a0c036f3a56745943aceaa914e5c629c1dc863c341eb5dba9ff39

Contents?: true

Size: 343 Bytes

Versions: 1

Compression:

Stored size: 343 Bytes

Contents

require "nil_conditional/version"

module NilConditional

  class ::Object
    def method_missing(name, *params)
      if name =~ /^.+_\?$/
        original_method = name.to_s.sub(/_\?$/, '').to_sym
        return send(original_method, *params) if respond_to?(original_method)
        nil
      else
        super
      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nil_conditional-0.0.1 lib/nil_conditional.rb