Class: Proc
Instance Method Summary (collapse)
-
- (Object) __context__
The context of the block.
-
- (Boolean) includes_mixin?(mod)
indicates whether the module mod is currently mixed in to the receiver.
-
- (Object) mixin(mod)
Mixes a module into the context of the Proc.
-
- (Object) mixout(mod)
Removes a module from the context of the Proc.
Instance Method Details
- (Object) __context__
The context of the block
25 26 27 |
# File 'lib/mixico.rb', line 25 def __context__ eval('self', binding) end |
- (Boolean) includes_mixin?(mod)
indicates whether the module mod is currently mixed in to the receiver
32 33 34 |
# File 'lib/mixico.rb', line 32 def includes_mixin? mod (class << __context__; self end).include? mod end |
- (Object) mixin(mod)
Mixes a module into the context of the Proc
42 43 44 |
# File 'lib/mixico.rb', line 42 def mixin mod __context__.extend mod end |
- (Object) mixout(mod)
Removes a module from the context of the Proc
53 54 55 |
# File 'lib/mixico.rb', line 53 def mixout mod (class << __context__; self end).disable_mixin mod end |