Module: HQMF2::Utilities
- Includes:
- HQMF::Conversion::Utilities
- Included in:
- Coded, DataCriteria, Document, PopulationCriteria, Precondition, Range, Reference, SubsetOperator, TemporalReference, Value
- Defined in:
- lib/hqmf-parser/2.0/utilities.rb
Class Method Summary collapse
-
.attr_val(node, xpath) ⇒ Object
Utility function to handle optional attributes.
Instance Method Summary collapse
-
#attr_val(xpath) ⇒ Object
Utility function to handle optional attributes.
- #to_xml ⇒ Object
Methods included from HQMF::Conversion::Utilities
#build_hash, #check_equality, #json_array, #openstruct_to_json
Class Method Details
.attr_val(node, xpath) ⇒ Object
Utility function to handle optional attributes
16 17 18 19 20 21 22 23 |
# File 'lib/hqmf-parser/2.0/utilities.rb', line 16 def self.attr_val(node, xpath) attr = node.at_xpath(xpath, HQMF2::Document::NAMESPACES) if attr attr.value else nil end end |
Instance Method Details
#attr_val(xpath) ⇒ Object
Utility function to handle optional attributes
9 10 11 |
# File 'lib/hqmf-parser/2.0/utilities.rb', line 9 def attr_val(xpath) Utilities::attr_val(@entry, xpath) end |
#to_xml ⇒ Object
25 26 27 |
# File 'lib/hqmf-parser/2.0/utilities.rb', line 25 def to_xml @entry.to_xml end |