class SBF::Client::ConfigEndpoint

Public Instance Methods

reload(entity) click to toggle source
# File lib/stbaldricks/endpoints/config.rb, line 7
def reload(entity)
  response = SBF::Client::Api::Request.get_request("#{base_uri}/get")
  parsed_response_body = JSON.parse(response.body).symbolize!

  raise SBF::Client::StandardError, 'Unable to retrieve settings from the api' unless ok?(response)

  # re-call initalize with the new api data. This should re-set all of the instance variables on the instance
  entity.send(:initialize, parsed_response_body)
end