Sha256: 34718ac5bbe8e7cc583a3a416789abb660ccce7b20fc0131bbccdc2cca8d2c80

Contents?: true

Size: 414 Bytes

Versions: 21

Compression:

Stored size: 414 Bytes

Contents

# encoding: utf-8

require 'faraday'

module BitBucket
  class Response::Xmlize < Response
    dependency 'nokogiri'

    define_parser do |body|
      ::Nokogiri::XML body
    end

    def parse(body)
      case body
      when ''
        nil
      when 'true'
        true
      when 'false'
        false
      else
        self.class.parser.call body
      end
    end
  end # Response::Xmlize
end # BitBucket

Version data entries

21 entries across 21 versions & 5 rubygems

Version Path
bitbucket_rest_api-0.1.0 lib/bitbucket_rest_api/response/xmlize.rb