class EventRegistryApi::Client

Constants

API_BASE_URL
SOURCES

Private Class Methods

_get(path, params) click to toggle source

Convenience method to call get on API. @param {String} @param {Hash} @return {Hash}

# File lib/event_registry_api/client.rb, line 24
def _get (path, params)
  response = HTTParty.get("#{ API_BASE_URL }#{ path }?#{ _query_string(params) }")

  JSON.parse(response) rescue nil
end
_query_string(hash) click to toggle source

Need to remove the array feature of to_query to key[]=value. @param {Hash} @return {String}

# File lib/event_registry_api/client.rb, line 35
def _query_string (hash)
  return nil unless hash.present?

  string = hash.to_query
  string.gsub("[]", "")
end