Sha256: de0b7a78b91d731946c12058f13012368ca504013a54e28af0f360a9452d4544

Contents?: true

Size: 372 Bytes

Versions: 1

Compression:

Stored size: 372 Bytes

Contents

require 'rexml/document'

module Headhunter
  class LocalResponse
    attr_reader :body

    def initialize(body)
      @body = body
      @headers = {'x-w3c-validator-status' => valid?}
    end

    def [](key)
      @headers[key]
    end

    def valid?
      REXML::Document.new(@body).root.each_element('//m:validity') { |e| return e.text == 'true' }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
headhunter-0.1.4 lib/headhunter/local_response.rb