Class: Naught::NullClassBuilder::Commands::Singleton
- Inherits:
-
Naught::NullClassBuilder::Command
- Object
- Naught::NullClassBuilder::Command
- Naught::NullClassBuilder::Commands::Singleton
- Defined in:
- lib/naught/null_class_builder/commands/singleton.rb
Instance Attribute Summary
Attributes inherited from Naught::NullClassBuilder::Command
Instance Method Summary collapse
Methods inherited from Naught::NullClassBuilder::Command
Constructor Details
This class inherits a constructor from Naught::NullClassBuilder::Command
Instance Method Details
#call ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/naught/null_class_builder/commands/singleton.rb', line 7 def call defer(:class => true) do |subject| require 'singleton' subject.module_eval do include ::Singleton def self.get(*) instance end %w(dup clone).each do |method_name| define_method method_name do self end end end end end |