Module: Tins::Blank::String

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

Overview

Blank behavior for String instances

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Strings are blank if they contain only whitespace characters. This uses a regex match against non-whitespace characters.

Returns:

  • (Boolean)

    true if the string contains only whitespace, false otherwise



113
114
115
# File 'lib/tins/xt/blank.rb', line 113

def blank?
  self !~ /\S/
end