Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/rspec/tap/formatters/core_ext/string.rb
Overview
Extensions to the core String class
Instance Method Summary collapse
-
#blank? ⇒ Boolean
Checks whether a string is blank.
-
#present? ⇒ Boolean
Checks whether a string is present.
Instance Method Details
#blank? ⇒ Boolean
Checks whether a string is blank. A string is considered blank if it is either empty or contains only whitespaces.
22 23 24 |
# File 'lib/rspec/tap/formatters/core_ext/string.rb', line 22 def blank? empty? || strip.empty? end |
#present? ⇒ Boolean
Checks whether a string is present. A string is considered present if it is not blank.
44 45 46 |
# File 'lib/rspec/tap/formatters/core_ext/string.rb', line 44 def present? !blank? end |