Module: Tins::Blank

Defined in:
lib/tins/xt/blank.rb

Overview

The Tins::Blank module provides a consistent way to check if objects are “blank” (empty, nil, or contain only whitespace). This follows Rails’ convention.

Examples:

Basic usage

"".blank?        # => true
"   ".blank?     # => true
"foo".blank?     # => false
[].blank?        # => true
[1, 2].blank?    # => false
nil.blank?       # => true
false.blank?     # => true
true.blank?      # => false

Using present?

"".present?      # => false
"foo".present?   # => true

Defined Under Namespace

Modules: Array, FalseClass, Hash, NilClass, Numeric, Object, String, TrueClass