Sha256: 77aefd8a800d16c8ae2a7555accfeb103e93cd5cc0e189d132ac7479909a7957

Contents?: true

Size: 269 Bytes

Versions: 11

Compression:

Stored size: 269 Bytes

Contents

class Musterb::ObjectExtractor
  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

11 entries across 11 versions & 1 rubygems

Version Path
musterb-1.0.1 lib/musterb/object_extractor.rb
musterb-0.2.0 lib/musterb/object_extractor.rb
musterb-0.1.2 lib/musterb/object_extractor.rb
musterb-0.1.1 lib/musterb/object_extractor.rb
musterb-0.1.0 lib/musterb/object_extractor.rb
musterb-0.0.7 lib/musterb/object_extractor.rb
musterb-0.0.6 lib/musterb/object_extractor.rb
musterb-0.0.5 lib/musterb/object_extractor.rb
musterb-0.0.4 lib/musterb/object_extractor.rb
musterb-0.0.3 lib/musterb/object_extractor.rb
musterb-0.0.2 lib/musterb/object_extractor.rb