Sha256: 8a513a43308f16102ee80988ffeb96449004719239061da8965f91dcd60c8d1e

Contents?: true

Size: 387 Bytes

Versions: 2

Compression:

Stored size: 387 Bytes

Contents

gem 'nokogiri', '~> 1.2.3'
require 'nokogiri'

module Relief
  class Parser
    attr_reader :root

    def initialize(name=nil, options={}, &block)
      @root = Element.new(name, options, &block)
    end

    def parse(document)
      unless document.is_a?(Nokogiri::XML::NodeSet)
        document = Nokogiri::XML(document.to_s)
      end

      @root.parse(document)
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
tylerhunt-relief-0.0.4 lib/relief/parser.rb
relief-0.0.4 lib/relief/parser.rb