Class: LaunchDarkly::Requestor
- Inherits:
-
Object
- Object
- LaunchDarkly::Requestor
- Defined in:
- lib/ldclient-rb/requestor.rb
Instance Method Summary collapse
-
#initialize(sdk_key, config) ⇒ Requestor
constructor
A new instance of Requestor.
- #request_all_data ⇒ Object
- #request_flag(key) ⇒ Object
- #request_segment(key) ⇒ Object
Constructor Details
#initialize(sdk_key, config) ⇒ Requestor
Returns a new instance of Requestor.
18 19 20 21 22 23 24 25 26 |
# File 'lib/ldclient-rb/requestor.rb', line 18 def initialize(sdk_key, config) @sdk_key = sdk_key @config = config @client = Faraday.new do |builder| builder.use :http_cache, store: @config.cache_store builder.adapter :net_http_persistent end end |
Instance Method Details
#request_all_data ⇒ Object
36 37 38 |
# File 'lib/ldclient-rb/requestor.rb', line 36 def request_all_data() make_request("/sdk/latest-all") end |
#request_flag(key) ⇒ Object
28 29 30 |
# File 'lib/ldclient-rb/requestor.rb', line 28 def request_flag(key) make_request("/sdk/latest-flags/" + key) end |
#request_segment(key) ⇒ Object
32 33 34 |
# File 'lib/ldclient-rb/requestor.rb', line 32 def request_segment(key) make_request("/sdk/latest-segments/" + key) end |