Module: Coincap::Helper

Defined in:
lib/coincap/helper.rb

Overview

Helper module

Class Method Summary collapse

Class Method Details

.fetch_data(uri_string, **queries_hash) ⇒ Hash

Request to read data

Parameters:

  • uri_string (String)

    String of the uri

  • queries_hash (Hash)

    Queries hash for the request

Returns:

  • (Hash)

    Hash of the response



20
21
22
23
24
# File 'lib/coincap/helper.rb', line 20

def fetch_data(uri_string, **queries_hash)
  url = build_uri(uri_string, **queries_hash)
  data = http_get url
  JSON.parse data
end