Class: FlexMock::Undefined

Inherits:
Object show all
Defined in:
lib/gems/flexmock-0.8.3/lib/flexmock/undefined.rb

Overview

Undefined is a self preserving undefined object. The result of any interaction with the undefined object will be the undefined object itself.

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



18
19
20
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/undefined.rb', line 18

def method_missing(sym, *args, &block)
  self
end

Instance Method Details

#cloneObject



30
31
32
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/undefined.rb', line 30

def clone
  self
end

#coerce(other) ⇒ Object



34
35
36
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/undefined.rb', line 34

def coerce(other)
  [FlexMock.undefined, FlexMock.undefined]
end

#inspectObject



26
27
28
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/undefined.rb', line 26

def inspect
  to_s
end

#to_sObject



22
23
24
# File 'lib/gems/flexmock-0.8.3/lib/flexmock/undefined.rb', line 22

def to_s
  "-UNDEFINED-"
end