Class: Naught::NullClassBuilder::Commands::Singleton

### Home Classes Methods

### In Files

- lib/naught/null_class_builder/commands/singleton.rb

### Parent

Naught::NullClassBuilder::Command

### Methods

- ::get
- #call

### Included Modules

- ::Singleton

### Class/Module Index

Quicksearch

- Naught
- Naught::Conversions
- Naught::NullClassBuilder
- Naught::NullClassBuilder::Command
- Naught::NullClassBuilder::Commands
- Naught::NullClassBuilder::Commands::DefineExplicitConversions
- Naught::NullClassBuilder::Commands::DefineImplicitConversions
- Naught::NullClassBuilder::Commands::Impersonate
- Naught::NullClassBuilder::Commands::Mimic
- Naught::NullClassBuilder::Commands::Pebble
- Naught::NullClassBuilder::Commands::PredicatesReturn
- Naught::NullClassBuilder::Commands::Singleton
- Naught::NullClassBuilder::Commands::Traceable
- Naught::NullObjectTag

No matching classes.

# Naught::NullClassBuilder::Commands::Singleton

### Public Class Methods

get(*) click to toggle source

    # File lib/naught/null_class_builder/commands/singleton.rb, line 11
    def self.get(*)
      instance
    end

### Public Instance Methods

call() click to toggle source

    # File lib/naught/null_class_builder/commands/singleton.rb, line 5
    def call
      defer(:class => true) do |subject|
        require 'singleton'
        subject.module_eval do
          include ::Singleton

          def self.get(*)
            instance
          end

          %(dup clone).each do |method_name|
            define_method method_name do
              self
            end
          end
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.