Class: Extract::Within

Inherits:
Base
  • Object
show all
Defined in:
lib/src/extract/within.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Extract::Base

Instance Method Details

#valueObject



5
6
7
8
9
10
11
# File 'lib/src/extract/within.rb', line 5

def value
  props = node.props
  paths = extractor.paths_of(node.path, props[:within])
  return "" if paths.empty?

  HashBuilder.new(Node.new(props, paths.first), extractor).value
end