Class: LaunchDarkly::Requestor
- Inherits:
-
Object
- Object
- LaunchDarkly::Requestor
- Defined in:
- lib/ldclient-rb/requestor.rb
Defined Under Namespace
Classes: CacheEntry
Instance Method Summary collapse
-
#initialize(sdk_key, config) ⇒ Requestor
constructor
A new instance of Requestor.
- #request_all_data ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(sdk_key, config) ⇒ Requestor
Returns a new instance of Requestor.
25 26 27 28 29 30 |
# File 'lib/ldclient-rb/requestor.rb', line 25 def initialize(sdk_key, config) @sdk_key = sdk_key @config = config @http_client = LaunchDarkly::Util.new_http_client(config.base_uri, config) @cache = @config.cache_store end |
Instance Method Details
#request_all_data ⇒ Object
32 33 34 35 |
# File 'lib/ldclient-rb/requestor.rb', line 32 def request_all_data() all_data = JSON.parse(make_request("/sdk/latest-all"), symbolize_names: true) Impl::Model.make_all_store_data(all_data, @config.logger) end |
#stop ⇒ Object
37 38 39 40 41 42 |
# File 'lib/ldclient-rb/requestor.rb', line 37 def stop begin @http_client.close rescue end end |