Class: Wicked::NotReturningMe
- Inherits:
-
BlankSlate
- Object
- BlankSlate
- Wicked::NotReturningMe
- Defined in:
- lib/wicked.rb
Overview
A proxy that returns the opposite of whatever you ask it.
Instance Method Summary collapse
-
#initialize(me) ⇒ NotReturningMe
constructor
A new instance of NotReturningMe.
- #method_missing(sym, *args, &block) ⇒ Object
Methods inherited from BlankSlate
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 |