Class: AwesomeXML::NodeXPath
- Inherits:
-
Object
- Object
- AwesomeXML::NodeXPath
- Defined in:
- lib/awesome_xml/node_xpath.rb
Instance Method Summary collapse
-
#initialize(node_name, options) ⇒ NodeXPath
constructor
Initialize this class by providing the name of the ‘AwesomeXML` node and an options hash.
-
#xpath ⇒ Object
Returns a String representing an XPath built from the options passed in at initialization time.
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, ) @node_name = node_name @specific_xpath = [:xpath] @element_option = [:element] @attribute_option = [:attribute] @self_option = [:self] @look_for = [:look_for] @array = [:array] end |
Instance Method Details
#xpath ⇒ Object
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 |