Class: Wombat::Property::Locators::Base
- Inherits:
-
Object
- Object
- Wombat::Property::Locators::Base
- Includes:
- Wombat::Processing::NodeSelector
- Defined in:
- lib/wombat/property/locators/base.rb
Overview
Abstract base class
Instance Method Summary collapse
-
#initialize(property) ⇒ Base
constructor
A new instance of Base.
- #locate(context, page = nil) ⇒ Object
Methods included from Wombat::Processing::NodeSelector
Constructor Details
#initialize(property) ⇒ Base
Returns a new instance of Base.
11 12 13 |
# File 'lib/wombat/property/locators/base.rb', line 11 def initialize(property) @property = property end |
Instance Method Details
#locate(context, page = nil) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/wombat/property/locators/base.rb', line 15 def locate(context, page = nil) @context = context raw_data = yield if block_given? data = @property.respond_to?(:callback) && @property.callback ? @property.callback.call(raw_data) : raw_data @property.wombat_property_name ? { @property.wombat_property_name => data } : data end |