Sha256: bf35f764c4b187b8aed344d2d89ad45f85da54feb28b867492993b83f11a5c1b
Contents?: true
Size: 730 Bytes
Versions: 24
Compression:
Stored size: 730 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Extensions #:nodoc: module Object #:nodoc: # This module behaves like the master jedi. module Yoda #:nodoc: # Do or do not, there is no try. -- Yoda. # # @example Do or do not. # object.do_or_do_not(:use, "The Force") # # @param [ String, Symbol ] name The method name. # @param [ Array ] *args The arguments. # # @return [ Object, nil ] The result of the method call or nil if the # method does not exist. # # @since 2.0.0.rc.1 def do_or_do_not(name, *args) respond_to?(name) ? send(name, *args) : nil end end end end end
Version data entries
24 entries across 24 versions & 3 rubygems