Class: String

Inherits:
Object show all
Defined in:
lib/pact/support/core_ext.rb

Constant Summary collapse

BLANK_RE =
/\A[[:space:]]*\z/

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/pact/support/core_ext.rb', line 26

def blank?
  empty? || BLANK_RE.match?(self)
end

#present?Boolean

Returns:

  • (Boolean)


30
# File 'lib/pact/support/core_ext.rb', line 30

def present? = !blank?