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.


126
127
128
129
# File 'lib/andand.rb', line 126

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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object


130
131
132
# File 'lib/andand.rb', line 130

def method_missing(*args)
  @me
end