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.



113
114
115
116
# File 'lib/wicked.rb', line 113

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



118
119
120
121
122
123
124
# File 'lib/wicked.rb', line 118

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