Skip to content

Commit c77e8bd

Browse files
Add Manual Exposures section to Ruby SDK documentation (#2959)
* Add Manual Exposures section to Ruby SDK documentation Co-Authored-By: [email protected] <[email protected]> * Fix ManualExposures implementation to use spread operator Co-Authored-By: [email protected] <[email protected]> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]>
1 parent 198e720 commit c77e8bd

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

docs/server/ruby/_manualExposures.mdx

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import CodeBlock from "@theme/CodeBlock";
2+
3+
export const Snippets = {
4+
// Gates
5+
gateSnippet: (
6+
<CodeBlock language="ruby">
7+
{`result = Statsig.check_gate(user, 'a_gate_name', CheckGateOptions.new(disable_log_exposure: true))`}
8+
</CodeBlock>
9+
),
10+
gateExposureSnippet: (
11+
<CodeBlock language="ruby">
12+
{`Statsig.manually_log_gate_exposure(user, 'a_gate_name')`}
13+
</CodeBlock>
14+
),
15+
// Configs
16+
configSnippet: (
17+
<CodeBlock language="ruby">
18+
{`config = Statsig.get_config(user, 'a_dynamic_config_name', GetConfigOptions.new(disable_log_exposure: true))`}
19+
</CodeBlock>
20+
),
21+
configExposureSnippet: (
22+
<CodeBlock language="ruby">
23+
{`Statsig.manually_log_config_exposure(user, 'a_dynamic_config_name')`}
24+
</CodeBlock>
25+
),
26+
// Experiment
27+
experimentSnippet: (
28+
<CodeBlock language="ruby">
29+
{`experiment = Statsig.get_experiment(user, 'an_experiment_name', GetExperimentOptions.new(disable_log_exposure: true))`}
30+
</CodeBlock>
31+
),
32+
experimentExposureSnippet: (
33+
<CodeBlock language="ruby">
34+
{`Statsig.manually_log_experiment_exposure(user, 'an_experiment_name')`}
35+
</CodeBlock>
36+
),
37+
// Layer
38+
layerSnippet: (
39+
<CodeBlock language="ruby">
40+
{`layer = Statsig.get_layer(user, 'a_layer_name', GetLayerOptions.new(disable_log_exposure: true))
41+
paramValue = layer.get('a_param_name', 'fallback_value')`}
42+
</CodeBlock>
43+
),
44+
layerExposureSnippet: (
45+
<CodeBlock language="ruby">
46+
{`Statsig.manually_log_layer_parameter_exposure(user, 'a_layer_name', 'a_param_name')`}
47+
</CodeBlock>
48+
),
49+
};

docs/server/rubySDK.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import PersistentStorageExample from "./ruby/_persistentStorageExample.mdx";
4343
import * as ReferenceSnippets from "./ruby/_reference.mdx";
4444
import ClientInitResponseSnippet from "./ruby/_clientInitResponse.mdx";
4545
import MultiInstanceExample from "./ruby/_multiInstanceExample.mdx";
46+
import { Snippets as ManualExposureSnippets } from "./ruby/_manualExposures.mdx";
4647

4748
export const Builder = SDKDocsBuilder({
4849
sections: [
@@ -71,6 +72,7 @@ export const Builder = SDKDocsBuilder({
7172
],
7273
[StatsigUser, {}],
7374
[StatsigOptions, { options: <Options /> }],
75+
[ManualExposures, { addedInVersion: "1.30.0", ...ManualExposureSnippets }],
7476
[Shutdown, { shutdown: <ShutdownSnippet /> }],
7577
[
7678
ClientInitResponse,

0 commit comments

Comments
 (0)