Class: Wombat::Property::Locators::Follow
- Defined in:
- lib/wombat/property/locators/follow.rb
Instance Method Summary collapse
Methods inherited from Base
Methods included from Wombat::Processing::NodeSelector
Constructor Details
This class inherits a constructor from Wombat::Property::Locators::Base
Instance Method Details
#locate(context, page = nil) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/wombat/property/locators/follow.rb', line 7 def locate(context, page = nil) super do locate_nodes(context).flat_map do |node| target_page = page.click node context = target_page.parser Hash.new.tap do |h| @property.values .select { |v| v.is_a?(Wombat::DSL::Property) || v.is_a?(Wombat::DSL::PropertyGroup) } .map { |p| Factory.locator_for(p).locate(context, page) } .map { |p| h.merge! p } end end end end |