Class: InlineTesting::TestEnvironment::Context
- Inherits:
-
Object
- Object
- InlineTesting::TestEnvironment::Context
- Includes:
- MetaTools
- Defined in:
- lib/inline_testing/test_environment/context.rb
Instance Method Summary collapse
-
#initialize(locals_obj) ⇒ Context
constructor
A new instance of Context.
- #update_methods ⇒ Object
Constructor Details
#initialize(locals_obj) ⇒ Context
Returns a new instance of Context.
7 8 9 |
# File 'lib/inline_testing/test_environment/context.rb', line 7 def initialize(locals_obj) @locals_obj, @delegated_methods = locals_obj, [] end |
Instance Method Details
#update_methods ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/inline_testing/test_environment/context.rb', line 11 def update_methods # TODO.. # Remove unused delegated methods # (@locals_obj.locals.keys - @delegated_methods).each do |local| # @delegated_methods.delete(local) # metaclass.remove_method(local) # end # Delegate locals methods @locals_obj.locals.keys.each do |local| (local) { @locals_obj.send(local) } unless .method_defined?(local) @delegated_methods << local end end |