Sha256: 8824682596c2db778acc4c7ec964b2ac1ff63dbdf13eac860de111176aced496

Contents?: true

Size: 351 Bytes

Versions: 1

Compression:

Stored size: 351 Bytes

Contents

class Musterb::InstanceVariableExtractor
  attr_reader :parent, :value

  def initialize(value, parent)
    @value = value
    @parent = parent
  end

  def [](symbol)
    puts "looking for #{symbol}"
    if value.instance_variable_defined?("@#{symbol}")
      value.instance_variable_get("@#{symbol}")
    else
      @parent[symbol]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
musterb-0.1.1 lib/musterb/instance_variable_extractor.rb