Class: Kickplan::Adapters::HTTP
Instance Attribute Summary
#config
Instance Method Summary
collapse
for, #initialize
included, #memoize, #synchronize, #unset
Instance Method Details
11
12
13
|
# File 'lib/kickplan/adapters/http.rb', line 11
def configure_account(params)
false
end
|
16
17
18
|
# File 'lib/kickplan/adapters/http.rb', line 16
def configure_feature(params)
false
end
|
#connection ⇒ Object
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/kickplan/adapters/http.rb', line 35
def connection
memoize do
Faraday::Connection.new(
url: config.endpoint,
proxy: config.proxy,
builder: config.middleware,
headers: {
user_agent: config.user_agent
}
)
end
end
|
#resolve_feature(key, params) ⇒ Object
20
21
22
|
# File 'lib/kickplan/adapters/http.rb', line 20
def resolve_feature(key, params)
post("features/#{key}", params.to_h).body
end
|
#resolve_features(params) ⇒ Object
24
25
26
|
# File 'lib/kickplan/adapters/http.rb', line 24
def resolve_features(params)
post("features", params.to_h).body
end
|
#update_metric(params) ⇒ Object
28
29
30
31
32
|
# File 'lib/kickplan/adapters/http.rb', line 28
def update_metric(params)
path = ["metrics", params.key, params.action].join("/")
post(path, params.to_h.slice(:value, :context)).body
end
|