Class: NumericMockObject
- Defined in:
- lib/extensions/mspec/mspec/mocks/proxy.rb
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ NumericMockObject
constructor
A new instance of NumericMockObject.
- #method_missing(sym, *args, &block) ⇒ Object
- #singleton_method_added(val) ⇒ Object
Methods inherited from Numeric
#abs, #div, #divmod, #floor, #integer?, #modulo, #nonzero?, #remainder, #zero?
Methods included from Comparable
#<, #<=, #==, #>, #>=, #between?
Constructor Details
#initialize(name, options = {}) ⇒ NumericMockObject
Returns a new instance of NumericMockObject.
14 15 16 17 |
# File 'lib/extensions/mspec/mspec/mocks/proxy.rb', line 14 def initialize(name, ={}) @name = name @null = [:null_object] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
19 20 21 |
# File 'lib/extensions/mspec/mspec/mocks/proxy.rb', line 19 def method_missing(sym, *args, &block) @null ? self : super end |
Instance Method Details
#singleton_method_added(val) ⇒ Object
23 24 |
# File 'lib/extensions/mspec/mspec/mocks/proxy.rb', line 23 def singleton_method_added(val) end |