Class: Naught::NullClassBuilder::Commands::Impersonate Private
- Inherits:
-
Mimic
- Object
- Naught::NullClassBuilder::Command
- Mimic
- Naught::NullClassBuilder::Commands::Impersonate
- Defined in:
- lib/naught/null_class_builder/commands/impersonate.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Build a null class that impersonates a given class
Unlike Mimic, Impersonate makes the null class inherit from the target,
so is_a? checks will pass.
Instance Attribute Summary
Attributes inherited from Mimic
#class_to_mimic, #example_instance, #include_dynamic, #include_super, #singleton_class
Attributes inherited from Naught::NullClassBuilder::Command
Instance Method Summary collapse
-
#initialize(builder, class_to_impersonate, options = {}) ⇒ Impersonate
constructor
private
Create an impersonate command for a class.
Methods inherited from Mimic
Methods inherited from Naught::NullClassBuilder::Command
Constructor Details
#initialize(builder, class_to_impersonate, options = {}) ⇒ Impersonate
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create an impersonate command for a class
17 18 19 20 |
# File 'lib/naught/null_class_builder/commands/impersonate.rb', line 17 def initialize(builder, class_to_impersonate, = {}) super builder.base_class = class_to_impersonate end |