Module: Tins::Blank::Numeric

Defined in:
lib/tins/xt/blank.rb

Overview

Blank behavior for Numeric instances

Numbers are considered blank only if they are zero. This implementation aliases the ‘zero?` method to `blank?`.

Class Method Summary collapse

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 zero? method to blank? in the including class/module.

Parameters:

  • modul (Object)

    the class or module that includes this module



130
131
132
133
134
# File 'lib/tins/xt/blank.rb', line 130

def self.included(modul)
  modul.module_eval do
    alias_method :blank?, :zero?
  end
end