posthog-ruby 3.26.4 → 3.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/posthog/feature_flag_evaluations.rb +11 -2
- data/lib/posthog/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9809cd9248724a9b3b032b1f822c7108da7a089330f37bacd1c86d7b614452e2
|
|
4
|
+
data.tar.gz: ca0f1dfcaecfbbaa4cf426ca0ab9eda422dede368cf55e899bb2aeb6e4a5b0ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c291a4b34b4d060bd0f85f0fe9622b5ee209b2f888dfff1b049108a63bc8bb8ee0f302218bffb20e71e31d04561b00dede786bb8dc57bced15d52578ca9a2dd
|
|
7
|
+
data.tar.gz: 8acdfca32f6df2ee0d9330539715bbc1d29b23a14c7ca6d2a458f6f8857d50ea9318d1f2d4c27354967c91abf5cc0ba87519d3255e5be849c5b3e78fd24d232f
|
|
@@ -81,11 +81,20 @@ module PostHog
|
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
# @param key [String, Symbol] The feature flag key.
|
|
84
|
-
# @
|
|
85
|
-
|
|
84
|
+
# @param default_value [Boolean, nil] Returned when the flag has no value in this
|
|
85
|
+
# snapshot — it was never loaded, the `/flags` request failed, or no flag with that
|
|
86
|
+
# key exists. A flag that does have a value, including `false` and variant strings,
|
|
87
|
+
# always wins over this default; so does a flag the server returned but marked as
|
|
88
|
+
# failed, which resolves to `false`. Defaults to `nil`, which keeps the historical
|
|
89
|
+
# `false` result for a missing flag.
|
|
90
|
+
# @return [Boolean] true when the flag is enabled, false when disabled, and the
|
|
91
|
+
# caller-supplied default (or false when none was supplied) when the flag is missing.
|
|
92
|
+
def enabled?(key, default_value: nil)
|
|
86
93
|
key = key.to_s
|
|
87
94
|
flag = @flags[key]
|
|
88
95
|
_record_access(key, flag)
|
|
96
|
+
return !!default_value if flag.nil? && !default_value.nil?
|
|
97
|
+
|
|
89
98
|
flag&.enabled ? true : false
|
|
90
99
|
end
|
|
91
100
|
|
data/lib/posthog/version.rb
CHANGED