Class: LaunchDarkly::Requestor

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/requestor.rb

Instance Method Summary collapse

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_dataObject



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