Module: Rescuetime::CoreExtensions::Object::Blank
- Included in:
- String
- Defined in:
- lib/rescuetime/core_extensions/object/blank.rb
Overview
Includes methods that check the presence or blankness of an object.
Instance Method Summary collapse
-
#blank? ⇒ Boolean
Returns true if the associated object is empty or falsey.
-
#present? ⇒ Boolean
Returns true if an object is truthy and is not empty (is not blank).
Instance Method Details
#blank? ⇒ Boolean
Returns true if the associated object is empty or falsey. Based on Rails’ ActiveSupport method Object#blank?
25 26 27 |
# File 'lib/rescuetime/core_extensions/object/blank.rb', line 25 def blank? respond_to?(:empty?) ? !!empty? : !self end |
#present? ⇒ Boolean
Returns true if an object is truthy and is not empty (is not blank). Based on Rails’ ActiveSupport method Object#present?
44 45 46 |
# File 'lib/rescuetime/core_extensions/object/blank.rb', line 44 def present? !blank? end |