Sha256: b6e8656816f82527a8ad21b46b94e7a11b64d2bae30a749b58e0992dc0969860

Contents?: true

Size: 509 Bytes

Versions: 7

Compression:

Stored size: 509 Bytes

Contents

require "binding_of_callers/version"
require 'binding_of_callers/revealed'
require 'binding_of_caller'

class Binding

  def of_callers
    enhance do |bi|
      BindingOfCallers::Revealed.new bi
    end
  end

  def of_callers!
    enhance do |bi|
      bi.extend BindingOfCallers::Reveal
    end
  end

  private

  def enhance &enhance
    collected.map(&enhance)
  end

  def collected
    n = 3
    bis = []
    while n < frame_count
      bis << of_caller(n)
      n = n.succ
    end
    bis
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
binding_of_callers-0.2.0 lib/binding_of_callers.rb
binding_of_callers-0.1.8 lib/binding_of_callers.rb
binding_of_callers-0.1.7 lib/binding_of_callers.rb
binding_of_callers-0.1.6 lib/binding_of_callers.rb
binding_of_callers-0.1.5 lib/binding_of_callers.rb
binding_of_callers-0.1.4 lib/binding_of_callers.rb
binding_of_callers-0.1.3 lib/binding_of_callers.rb