A gem to encapsulate reference data in Springshot's APIs


Add it to your gemfile.

gem 'reference-data', git: ''


Look up remote reference data (configured in config/reference-data.yml) from multiple resources using a single interface:

ReferenceData.lookup('referenceOne', 123) => { 'a' => 'hash' }


The configuration file (config/reference-data.yml) is loaded first as an ERB template to parse any locally defined authentication data or other mutable request formats. E.g. if a resource requires you to log in for an authentication token, you can write a method to return that token and pass that to the reference-data.yml config via ERB.

key is used to substitute in the passed reference value. More complex queries are not yet supported.

If a request fails ReferenceData will attempt to reload the config and try the inquiry with refreshed credentials.

  resource_url:<%= Test.token %>/{key}

  resource_url:{key}?app_key=<%= Test.api_key %>