Class: Wombat::Property::Locators::PropertyGroup

Inherits:
Base
  • Object
show all
Defined in:
lib/wombat/property/locators/property_group.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Wombat::Processing::NodeSelector

#select_nodes

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
# File 'lib/wombat/property/locators/property_group.rb', line 7

def locate(context, page = nil)
  super do
    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