Determines whether the specified value is blank.
An object is blank if it’s false, empty, or a whitespace string. For example, “”, “ “, nil, [], and {} are blank.
@api semipublic
# File lib/dm-core/support/ext/blank.rb, line 9 9: def self.blank?(value) 10: return value.blank? if value.respond_to?(:blank?) 11: case value 12: when ::NilClass, ::FalseClass 13: true 14: when ::TrueClass, ::Numeric 15: false 16: when ::Array, ::Hash 17: value.empty? 18: when ::String 19: value !~ /\S/ 20: else 21: value.nil? || (value.respond_to?(:empty?) && value.empty?) 22: end 23: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.