Class: ParseDecision::Plugin::ProductXpath
- Defined in:
- lib/parse_decision/plugin/product_xpath.rb
Overview
####################################################################### Product XPath plugin
Instance Method Summary collapse
- #execute(context, ln) ⇒ Object
-
#initialize ⇒ ProductXpath
constructor
A new instance of ProductXpath.
Methods inherited from Plugin
#apply_template, #apply_templates, #write_to_file
Constructor Details
#initialize ⇒ ProductXpath
Returns a new instance of ProductXpath.
19 20 21 22 23 |
# File 'lib/parse_decision/plugin/product_xpath.rb', line 19 def initialize() $LOG.debug "ProductXpath::initialize" @searchStr1 = "*PRODUCT XPATH xml*" @searchStr2 = "<PPXPATH>" end |
Instance Method Details
#execute(context, ln) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/parse_decision/plugin/product_xpath.rb', line 25 def execute(context, ln) #$LOG.debug "ProductXpath::execute" if((context.state == :app) && ln.include?(@searchStr1)) context.state = :productXpath return true end if((context.state == :productXpath) && ln.include?(@searchStr2)) context.state = :app # We just store the product xpath in the context so it can # be incorporated into the product rules file later. context[:productXpath] = ln return true end if(context.state == :productXpath) # Probably a blank line. Claim it so we don't waste anyone else's time. return true end return false end |