Class: Naught::NullClassBuilder::Commands::Traceable

### Home Classes Methods

### In Files

- lib/naught/null_class_builder/commands/traceable.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::Traceable

### Public Class Methods

new(options = {}) click to toggle source

    # File lib/naught/null_class_builder/commands/traceable.rb, line 10
    def initialize(options = {})
      range = (RUBY_VERSION.to_f == 1.9 && RUBY_PLATFORM != 'java') ? 4 : 3
      backtrace = options.fetch(:caller) { Kernel.caller(range) }
      @__file__, line, _ = backtrace[0].split(':')
      @__line__ = line.to_i
    end

### Public Instance Methods

call() click to toggle source

    # File lib/naught/null_class_builder/commands/traceable.rb, line 5
    def call
      defer do |subject|
        subject.module_eval do
          attr_reader :__file__, :__line__

          def initialize(options = {})
            range = (RUBY_VERSION.to_f == 1.9 && RUBY_PLATFORM != 'java') ? 4 : 3
            backtrace = options.fetch(:caller) { Kernel.caller(range) }
            @__file__, line, _ = backtrace[0].split(':')
            @__line__ = line.to_i
          end
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.