Sha256: 15665ae06aa9d6ffe6cafb38b0f0ac240d76a399cdcaa905108b0225289c29dd

Contents?: true

Size: 776 Bytes

Versions: 39

Compression:

Stored size: 776 Bytes

Contents

module HQMF2
  module Utilities
    
    include HQMF::Conversion::Utilities
    
    # Utility function to handle optional attributes
    # @param xpath an XPath that identifies an XML attribute
    # @return the value of the attribute or nil if the attribute is missing
    def attr_val(xpath)
      Utilities::attr_val(@entry, xpath)
    end
    
    # Utility function to handle optional attributes
    # @param xpath an XPath that identifies an XML attribute
    # @return the value of the attribute or nil if the attribute is missing
    def self.attr_val(node, xpath)
      attr = node.at_xpath(xpath, HQMF2::Document::NAMESPACES)
      if attr
        attr.value
      else
        nil
      end
    end
    
    def to_xml
      @entry.to_xml
    end
    
  end
end  

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
health-data-standards-3.6.1 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.5.3 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.5.2 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.5.1 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.5.0 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.4.6 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.4.5 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.4.4 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.4.3 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.4.2 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.4.1 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.4.0 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.2.12 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.3.0 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.2.11 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.2.10 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.2.8 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.2.7 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.2.6 lib/hqmf-parser/2.0/utilities.rb
health-data-standards-3.2.5 lib/hqmf-parser/2.0/utilities.rb