Sha256: b09be7d8ff644ce0b90b7e337982bc6e11a0bd93e1afe798fa554f968c3ebdd7

Contents?: true

Size: 429 Bytes

Versions: 1

Compression:

Stored size: 429 Bytes

Contents

# frozen_string_literal: true
require 'faraday'

module BitBucket
  class Response::Jsonize < Response
    dependency 'multi_json'

    define_parser do |body|
      MultiJson.load(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::Jsonize
end # BitBucket

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bitbuckets-0.2.0 lib/bitbucket_rest_api/response/jsonize.rb