Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/Object/blankQ.rb,
lib/Object/default_to.rb
Overview
Changes:
-
Now using a more recent version from ActiveSupport. This more recent version from ActiveSupport is likely more efficient and slightly more succinct.
Instance Method Summary collapse
- #blank? ⇒ Boolean
- #default_to(o) ⇒ Object (also: #defaults_to, #default_is)
Instance Method Details
#blank? ⇒ Boolean
14 15 16 |
# File 'lib/Object/blankQ.rb', line 14 def blank? respond_to?(:empty?) ? empty? : !self end |
#default_to(o) ⇒ Object Also known as: defaults_to, default_is
19 20 21 |
# File 'lib/Object/default_to.rb', line 19 def default_to(o) self end |