Sha256: ea907b75c5e9e6f9b5d9e69eb39818561ab450b11c280e17fddac2e9abc579dc

Contents?: true

Size: 303 Bytes

Versions: 3

Compression:

Stored size: 303 Bytes

Contents

class Musterb::RailsLocalsExtractor
  attr_reader :parent, :value

  def initialize(locals, binding, parent)
    @locals = locals
    @parent = parent
    @binding = binding
  end

  def [](symbol)
    if @locals.include? symbol
      @binding.eval symbol
    else
      parent[symbol]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
musterb-1.0.1 lib/musterb/rails_locals_extractor.rb
musterb-0.2.0 lib/musterb/rails_locals_extractor.rb
musterb-0.1.2 lib/musterb/rails_locals_extractor.rb