Module: Wicked::Good

Included in:
Object
Defined in:
lib/wicked.rb

Overview

Got it? Wicked Good!

Instance Method Summary collapse

Instance Method Details

#aint(p = nil) ⇒ Object Also known as: andnot, isnt, is_not

Guarded method negation in the style of andand Returns the logical opposite of the method invoked on the receiver Returns nil if receiver is nil or doesn’t have method.

[].aint.empty?  => false
[].aint.nil?    => true
it.aint.broken? => false

Don’t be a doofus, use this wisely, on boolean methods only if you know what’s good for you.



35
36
37
# File 'lib/wicked.rb', line 35

def aint(p = nil)
  NotReturningMe.new(self) 
end

#aint_nothin?Boolean Also known as: aint_it_somethin?, aint_nothing?

A funny byproduct of using aint… nil.aint_nothin? => false

Returns:

  • (Boolean)


41
42
43
# File 'lib/wicked.rb', line 41

def aint_nothin?
  self.aint.nil?
end

#is_nothin?Boolean Also known as: is_nothing?

nil.is_nothin? => true

Returns:

  • (Boolean)


47
48
49
# File 'lib/wicked.rb', line 47

def is_nothin?
  !self.is.nil?
end