Class: PostHog::SendFeatureFlagsOptions Deprecated
- Inherits:
-
Object
- Object
- PostHog::SendFeatureFlagsOptions
- Defined in:
- lib/posthog/send_feature_flags_options.rb
Overview
Deprecated.
Prefer passing a FeatureFlagEvaluations snapshot to ‘capture(flags:)`.
Options for configuring deprecated feature flag behavior in capture calls.
Instance Attribute Summary collapse
-
#group_properties ⇒ Hash
readonly
Group properties to use for feature flag evaluation.
-
#only_evaluate_locally ⇒ Boolean?
readonly
Whether remote feature flag evaluation should be skipped.
-
#person_properties ⇒ Hash
readonly
Person properties to use for feature flag evaluation.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(only_evaluate_locally: nil, person_properties: nil, group_properties: nil) ⇒ SendFeatureFlagsOptions
constructor
A new instance of SendFeatureFlagsOptions.
-
#to_h ⇒ Hash
A hash representation suitable for ‘capture(send_feature_flags:)`.
Constructor Details
#initialize(only_evaluate_locally: nil, person_properties: nil, group_properties: nil) ⇒ SendFeatureFlagsOptions
Returns a new instance of SendFeatureFlagsOptions.
22 23 24 25 26 |
# File 'lib/posthog/send_feature_flags_options.rb', line 22 def initialize(only_evaluate_locally: nil, person_properties: nil, group_properties: nil) @only_evaluate_locally = only_evaluate_locally @person_properties = person_properties || {} @group_properties = group_properties || {} end |
Instance Attribute Details
#group_properties ⇒ Hash (readonly)
Returns Group properties to use for feature flag evaluation.
17 18 19 |
# File 'lib/posthog/send_feature_flags_options.rb', line 17 def group_properties @group_properties end |
#only_evaluate_locally ⇒ Boolean? (readonly)
Returns Whether remote feature flag evaluation should be skipped.
11 12 13 |
# File 'lib/posthog/send_feature_flags_options.rb', line 11 def only_evaluate_locally @only_evaluate_locally end |
#person_properties ⇒ Hash (readonly)
Returns Person properties to use for feature flag evaluation.
14 15 16 |
# File 'lib/posthog/send_feature_flags_options.rb', line 14 def person_properties @person_properties end |
Class Method Details
.from_hash(hash) ⇒ PostHog::SendFeatureFlagsOptions?
39 40 41 42 43 44 45 46 47 |
# File 'lib/posthog/send_feature_flags_options.rb', line 39 def self.from_hash(hash) return nil unless hash.is_a?(Hash) new( only_evaluate_locally: PostHog::Utils.get_by_symbol_or_string_key(hash, :only_evaluate_locally), person_properties: PostHog::Utils.get_by_symbol_or_string_key(hash, :person_properties), group_properties: PostHog::Utils.get_by_symbol_or_string_key(hash, :group_properties) ) end |
Instance Method Details
#to_h ⇒ Hash
Returns A hash representation suitable for ‘capture(send_feature_flags:)`.
29 30 31 32 33 34 35 |
# File 'lib/posthog/send_feature_flags_options.rb', line 29 def to_h { only_evaluate_locally: @only_evaluate_locally, person_properties: @person_properties, group_properties: @group_properties } end |