Sha256: 6c1a4ab61c0dc49a8ec8e936451fb7a04fa9b784c63e965265ba621572a15e2b

Contents?: true

Size: 442 Bytes

Versions: 12

Compression:

Stored size: 442 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

12 entries across 12 versions & 1 rubygems

Version Path
jazzy-0.1.4 lib/jazzy/xml_helper.rb
jazzy-0.1.3 lib/jazzy/xml_helper.rb
jazzy-0.1.2 lib/jazzy/xml_helper.rb
jazzy-0.1.1 lib/jazzy/xml_helper.rb
jazzy-0.1.0 lib/jazzy/xml_helper.rb
jazzy-0.0.20 lib/jazzy/xml_helper.rb
jazzy-0.0.19 lib/jazzy/xml_helper.rb
jazzy-0.0.18 lib/jazzy/xml_helper.rb
jazzy-0.0.17 lib/jazzy/xml_helper.rb
jazzy-0.0.16 lib/jazzy/xml_helper.rb
jazzy-0.0.15 lib/jazzy/xml_helper.rb
jazzy-0.0.14 lib/jazzy/xml_helper.rb