Method: Hanami::Utils::Blank.blank?
- Defined in:
- lib/hanami/utils/blank.rb
.blank?(object) ⇒ TrueClass, FalseClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Checks if object is blank
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/hanami/utils/blank.rb', line 33 def self.blank?(object) case object when String, ::String STRING_MATCHER === object when ::Hash, ::Array object.empty? when TrueClass, Numeric false when FalseClass, NilClass true else object.respond_to?(:empty?) ? object.empty? : !object end end |