Class: NumericMockObject

Inherits:
Numeric
  • Object
show all
Defined in:
lib/mspec/mocks/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ NumericMockObject

Returns a new instance of NumericMockObject.



13
14
15
16
# File 'lib/mspec/mocks/proxy.rb', line 13

def initialize(name, options={})
  @name = name
  @null = options[:null_object]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



18
19
20
# File 'lib/mspec/mocks/proxy.rb', line 18

def method_missing(sym, *args, &block)
  @null ? self : super
end

Instance Method Details

#singleton_method_added(val) ⇒ Object



22
23
# File 'lib/mspec/mocks/proxy.rb', line 22

def singleton_method_added(val)
end