Sha256: 0c2b577ad0648f81493630c398af96dd63cfc4fcbee58a5d3ab979773fd0d470
Contents?: true
Size: 392 Bytes
Versions: 27
Compression:
Stored size: 392 Bytes
Contents
module Kernel # Tests to see if something has value. An object # is considered to have value if it is not nil? # and if it responds to #empty?, is not empty. # # nil.val? #=> false # [].val? #=> false # 10.val? #=> true # [nil].val? #=> true def val? return false if nil? return false if empty? if respond_to?(:empty?) true end end
Version data entries
27 entries across 26 versions & 3 rubygems