Module: Tins::Blank::Hash
- Defined in:
- lib/tins/xt/blank.rb
Overview
Blank behavior for Hash instances
Hashes are blank if they are empty. This implementation aliases the ‘empty?` method to `blank?`.
Class Method Summary collapse
-
.included(modul) ⇒ Object
The included method is a hook that gets called when this module is included in another class or module.
Class Method Details
.included(modul) ⇒ Object
The included method is a hook that gets called when this module is included in another class or module.
It sets up blank? behavior by aliasing the empty? method to blank? in the including class/module.
100 101 102 103 104 |
# File 'lib/tins/xt/blank.rb', line 100 def self.included(modul) modul.module_eval do alias_method :blank?, :empty? end end |