Sha256: e69d931d00f9949ddf17f7516d41d3ff043e1f1d85cb05152955d69f01e46db7

Contents?: true

Size: 406 Bytes

Versions: 1

Compression:

Stored size: 406 Bytes

Contents

# frozen_string_literal: true

require 'json'
require 'hashie/mash'

class Hphones
  ##
  # Represents an API response
  #
  class Response
    def initialize(http_response)
      @http_response = http_response
    end

    def data
      @data ||= parse_json http_response.body
    end

    private

    attr_reader :http_response

    def parse_json(json_str)
      JSON.parse json_str
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hphones-ruby-0.0.1 lib/hphones/response.rb