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.



11
12
13
14
15
16
17
18
19
# File 'lib/ldclient-rb/requestor.rb', line 11

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



29
30
31
# File 'lib/ldclient-rb/requestor.rb', line 29

def request_all_data()
  make_request("/sdk/latest-all")
end

#request_flag(key) ⇒ Object



21
22
23
# File 'lib/ldclient-rb/requestor.rb', line 21

def request_flag(key)
  make_request("/sdk/latest-flags/" + key)
end

#request_segment(key) ⇒ Object



25
26
27
# File 'lib/ldclient-rb/requestor.rb', line 25

def request_segment(key)
  make_request("/sdk/latest-segments/" + key)
end