Class: ATypes::EnumerableWrap
- Defined in:
- lib/a_types/decorators/enuemrable_wrap.rb
Overview
Adds enumerable convenience methods to any object, preserving its original behavior.
Instance Method Summary collapse
-
#blank? ⇒ true, false
Checks whether the object is nil or empty.
-
#filled? ⇒ true, false
Returns true if this objects contains any actual content.
Methods inherited from Wrapper
Instance Method Details
#blank? ⇒ true, false
Checks whether the object is nil or empty.
16 17 18 19 20 21 22 |
# File 'lib/a_types/decorators/enuemrable_wrap.rb', line 16 def blank? if content.respond_to?(:empty?) content.empty? else content.nil? end end |
#filled? ⇒ true, false
Returns true if this objects contains any actual content.
8 9 10 |
# File 'lib/a_types/decorators/enuemrable_wrap.rb', line 8 def filled? !blank? end |