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.



8
9
10
11
12
13
14
15
16
# File 'lib/ldclient-rb/requestor.rb', line 8

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_flagsObject



18
19
20
# File 'lib/ldclient-rb/requestor.rb', line 18

def request_all_flags()
  make_request("/sdk/latest-flags")
end

#request_flag(key) ⇒ Object



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

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