Sha256: b2b6dbe410e53d16eafe64c03b450a83d2a041c7c74ba50314970160ee253153

Contents?: true

Size: 378 Bytes

Versions: 4

Compression:

Stored size: 378 Bytes

Contents

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

module Relief
  class Parser
    attr_reader :root

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

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

      @root.parse(document)
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
tylerhunt-relief-0.0.1 lib/relief/parser.rb
tylerhunt-relief-0.0.2 lib/relief/parser.rb
tylerhunt-relief-0.0.3 lib/relief/parser.rb
relief-0.0.3 lib/relief/parser.rb