Module: Tins::Blank::Object
- Defined in:
- lib/tins/xt/blank.rb
Overview
Blank behavior for Object instances
Instance Method Summary collapse
-
#blank? ⇒ Boolean
Provides a fallback implementation that checks for ‘empty?` method, falling back to negation of truthiness if not defined.
-
#present? ⇒ Boolean
Checks if the object is not blank.
Instance Method Details
#blank? ⇒ Boolean
Provides a fallback implementation that checks for ‘empty?` method, falling back to negation of truthiness if not defined.
26 27 28 |
# File 'lib/tins/xt/blank.rb', line 26 def blank? respond_to?(:empty?) ? empty? : !self end |
#present? ⇒ Boolean
Checks if the object is not blank
33 34 35 |
# File 'lib/tins/xt/blank.rb', line 33 def present? !blank? end |