Class: PostHog::MCP::UserIdentity
- Inherits:
-
Struct
- Object
- Struct
- PostHog::MCP::UserIdentity
- Defined in:
- lib/posthog/mcp/options.rb
Overview
Resolved identity for a session. distinct_id becomes the event's
distinct id, properties go to $set, groups ({group_type => group_key})
are stamped on every event as $groups.
Instance Attribute Summary collapse
-
#distinct_id ⇒ Object
Returns the value of attribute distinct_id.
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#properties ⇒ Object
Returns the value of attribute properties.
Class Method Summary collapse
- .coerce(value) ⇒ Object private
Instance Attribute Details
#distinct_id ⇒ Object
Returns the value of attribute distinct_id
20 21 22 |
# File 'lib/posthog/mcp/options.rb', line 20 def distinct_id @distinct_id end |
#groups ⇒ Object
Returns the value of attribute groups
20 21 22 |
# File 'lib/posthog/mcp/options.rb', line 20 def groups @groups end |
#properties ⇒ Object
Returns the value of attribute properties
20 21 22 |
# File 'lib/posthog/mcp/options.rb', line 20 def properties @properties end |
Class Method Details
.coerce(value) ⇒ 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.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/posthog/mcp/options.rb', line 22 def self.coerce(value) case value when UserIdentity then value when Hash distinct_id = value[:distinct_id] || value['distinct_id'] || value[:distinctId] || value['distinctId'] return nil if distinct_id.nil? || distinct_id.to_s.empty? new( distinct_id: distinct_id.to_s, properties: value[:properties] || value['properties'], groups: value[:groups] || value['groups'] ) end end |