Class: PowerAssert::TraceContext (Ruby 2.7.5)
Description: Class : PowerAssert::TraceContext - Ruby 2.7.5

### Home Classes Methods

### In Files

- power_assert-1.1.7/lib/power_assert/context.rb

### Parent

PowerAssert::Context

### Methods

- ::new
- #disable
- #enable
- #enabled?

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- PowerAssert
- PowerAssert::BlockContext
- PowerAssert::Configuration
- PowerAssert::Context
- PowerAssert::Empty
- PowerAssert::Formatter
- PowerAssert::InspectedValue
- PowerAssert::Parser
- PowerAssert::Parser::Branch
- PowerAssert::Parser::DummyParser
- PowerAssert::SafeInspectable
- PowerAssert::TraceContext

No matching classes.

# PowerAssert::TraceContext

### Public Class Methods

new(binding) click to toggle source

                   # File power_assert-1.1.7/lib/power_assert/context.rb, line 211
    def initialize(binding)
      target_frame, *base = PowerAssert.app_caller_locations
      super(base.length)
      path = target_frame.path
      lineno = target_frame.lineno
      if File.exist?(path)
        line = File.open(path) {|fp| fp.each_line.drop(lineno - 1).first }
        @parser = Parser.new(line, path, lineno, binding)
      else
        @parser = Parser::DUMMY
      end
    end

### Public Instance Methods

disable() click to toggle source

                   # File power_assert-1.1.7/lib/power_assert/context.rb, line 229
    def disable
      @trace_return.disable
    end

enable() click to toggle source

                   # File power_assert-1.1.7/lib/power_assert/context.rb, line 224
    def enable
      @fired = true
      @trace_return.enable
    end

enabled?() click to toggle source

                   # File power_assert-1.1.7/lib/power_assert/context.rb, line 233
    def enabled?
      @trace_return.enabled?
    end