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.



99
100
101
102
# File 'lib/wicked.rb', line 99

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



104
105
106
107
108
109
110
# File 'lib/wicked.rb', line 104

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