Class: Wicked::NotReturningMe

Inherits:
BlankSlate show all
Defined in:
lib/wicked.rb

Overview

A proxy that returns the opposite of whatever you ask it.

Instance Method Summary collapse

Methods inherited from BlankSlate

wipe

Constructor Details

#initialize(me) ⇒ NotReturningMe

Returns a new instance of NotReturningMe.



86
87
88
89
# File 'lib/wicked.rb', line 86

def initialize(me)
  super()
  @me = me
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



91
92
93
94
95
96
97
# File 'lib/wicked.rb', line 91

def method_missing(sym, *args, &block)
  begin
    !@me.__send__(sym, *args, &block)
  rescue NoMethodError
    nil
  end
end