Sha256: f87a93fc696174fe9ad4c4f326992f9ecaf4067930207ba215c45d773136e11b

Contents?: true

Size: 436 Bytes

Versions: 8

Compression:

Stored size: 436 Bytes

Contents

require 'nokogiri'

module Jazzy
  module XMLHelper
    # Gets value of XML attribute or nil (i.e. file in <Class file="Musician.swift"></Class>)
    def self.attribute(node, name)
      node.attributes[name].value if node.attributes[name]
    end

    # Gets text in XML node or nil (i.e. s:cMyUSR <USR>s:cMyUSR</USR>)
    def self.xpath(node, xpath)
      node.xpath(xpath).text if node.xpath(xpath).text.length > 0
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jazzy-0.0.13 lib/jazzy/xml_helper.rb
jazzy-0.0.12 lib/jazzy/xml_helper.rb
jazzy-0.0.11 lib/jazzy/xml_helper.rb
jazzy-0.0.10 lib/jazzy/xml_helper.rb
jazzy-0.0.9 lib/jazzy/xml_helper.rb
jazzy-0.0.8 lib/jazzy/xml_helper.rb
jazzy-0.0.7 lib/jazzy/xml_helper.rb
jazzy-0.0.6 lib/jazzy/xml_helper.rb