Sha256: 282bd22385c702f044ddef6959675189d6abb62f4ebabd05c02e1e8d7c8c06f4

Contents?: true

Size: 325 Bytes

Versions: 1

Compression:

Stored size: 325 Bytes

Contents

require 'nokogiri'

module Mblox
  class MissingExpectedXmlContentError < StandardError; end
  class << self
    def from_xml(xml)
      Nokogiri::XML(xml) { |config| config.nonet }.tap do |_|
        raise MissingExpectedXmlContentError, "'#{xml}' is not parseable as XML" unless _.errors.empty?
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mblox-0.3.0 lib/mblox/from_xml.rb