Class: AwesomeXML::NodeXPath

Inherits:
Object
  • Object
show all
Defined in:
lib/awesome_xml/node_xpath.rb

Instance Method Summary collapse

Constructor Details

#initialize(node_name, options) ⇒ NodeXPath

Initialize this class by providing the name of the ‘AwesomeXML` node and an options hash. For more information on how the options work, please refer to the README.



11
12
13
14
15
16
17
18
19
# File 'lib/awesome_xml/node_xpath.rb', line 11

def initialize(node_name, options)
  @node_name = node_name
  @specific_xpath = options[:xpath]
  @element_option = options[:element]
  @attribute_option = options[:attribute]
  @self_option = options[:self]
  @look_for = options[:look_for]
  @array = options[:array]
end

Instance Method Details

#xpathObject

Returns a String representing an XPath built from the options passed in at initialization time.



22
23
24
# File 'lib/awesome_xml/node_xpath.rb', line 22

def xpath
  specific_xpath || xpath_by_tag_type
end