Class: Naught::NullClassBuilder::Commands::Mimic

### Home Classes Methods

### In Files

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

### Parent

Naught::NullClassBuilder::Command

### Methods

- ::new
- #call

### 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::Mimic

### Attributes

class_to_mimic[R]
include_super[R]

### Public Class Methods

new(builder, class_to_mimic, options = {}) click to toggle source

    # File lib/naught/null_class_builder/commands/mimic.rb, line 8
    def initialize(builder, class_to_mimic, options = {})
      super(builder)

      @class_to_mimic = class_to_mimic
      @include_super = options.fetch(:include_super) { true }

      builder.base_class   = root_class_of(class_to_mimic)
      builder.inspect_proc = lambda { "<null:#{class_to_mimic}>" }
      builder.interface_defined = true
    end

### Public Instance Methods

call() click to toggle source

    # File lib/naught/null_class_builder/commands/mimic.rb, line 19
    def call
      defer do |subject|
        methods_to_stub.each do |method_name|
          builder.stub_method(subject, method_name)
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.