Class: Minitest::SelfMonad
- Inherits:
-
ValueMonad
- Object
- ValueMonad
- Minitest::SelfMonad
- Defined in:
- lib/minitest/bacon.rb
Constant Summary
Constants inherited from ValueMonad
Instance Method Summary collapse
-
#initialize ⇒ SelfMonad
constructor
A new instance of SelfMonad.
-
#method_missing(name, *args, &block) ⇒ Object
hacky, saves my butt on StackDepth.
Methods inherited from ValueMonad
#assert, #be, #be_false, #be_true, #change?, #equal, #flunk, #identical_to, #match, #not, #raise?, #throw?
Constructor Details
#initialize ⇒ SelfMonad
Returns a new instance of SelfMonad.
105 106 107 108 |
# File 'lib/minitest/bacon.rb', line 105 def initialize super self @depth = 0 end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
hacky, saves my butt on StackDepth
110 111 112 113 114 115 |
# File 'lib/minitest/bacon.rb', line 110 def method_missing(name, *args, &block) # hacky, saves my butt on StackDepth @depth += 1 super unless @depth > 1 ensure @depth -= 1 end |