Class: AndAnd::MockReturningMe

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

Overview

A proxy that returns its target without invoking the method you invoke. Useful for nil.andand and #dont

Instance Method Summary collapse

Methods inherited from BlankSlate

wipe

Constructor Details

#initialize(me) ⇒ MockReturningMe

Returns a new instance of MockReturningMe.



119
120
121
122
# File 'lib/andand.rb', line 119

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



123
124
125
# File 'lib/andand.rb', line 123

def method_missing(*args)
  @me
end