Sha256: e3d9f97c5384a8219ff2b929d399a51d00bfcda641457416fbd62903fe8f426b

Contents?: true

Size: 287 Bytes

Versions: 1

Compression:

Stored size: 287 Bytes

Contents

class Musterb::ObjectExtractor < Musterb::Extractor
  attr_reader :parent, :value

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

  def [](symbol)
    if @value.respond_to? symbol
      @value.send(symbol)
    else
      @parent[symbol]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
musterb-1.0.0 lib/musterb/object_extractor.rb