Method: Module#alias_tester

Defined in:
lib/core/facets/module/attr_tester.rb

#alias_tester(*args) ⇒ Object

Create aliases for flag reader.

Note that this method is not a common core extension and is not loaded automatically when using require 'facets'.

CREDIT: Trans

Uncommon:

  • require ‘facets/module/attr_tester’



48
49
50
51
52
53
54
# File 'lib/core/facets/module/attr_tester.rb', line 48

def alias_tester(*args)
  orig = args.last
  args = args - [orig]
  args.each do |name|
    alias_method("#{name}?", "#{orig}?")
  end
end