Class: WorkOS::EventContext
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- WorkOS::EventContext
- Defined in:
- lib/workos/shared/event_context.rb
Constant Summary collapse
- HASH_ATTRS =
{ google_analytics_client_id: :google_analytics_client_id, google_analytics_sessions: :google_analytics_sessions, ajs_anonymous_id: :ajs_anonymous_id, client_id: :client_id, actor: :actor, previous_attributes: :previous_attributes }.freeze
Instance Attribute Summary collapse
-
#actor ⇒ Object
Returns the value of attribute actor.
-
#ajs_anonymous_id ⇒ Object
Returns the value of attribute ajs_anonymous_id.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#google_analytics_client_id ⇒ Object
Returns the value of attribute google_analytics_client_id.
-
#google_analytics_sessions ⇒ Object
Returns the value of attribute google_analytics_sessions.
-
#previous_attributes ⇒ Object
Returns the value of attribute previous_attributes.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ EventContext
constructor
A new instance of EventContext.
Methods inherited from Types::BaseModel
Methods included from HashProvider
Constructor Details
#initialize(json) ⇒ EventContext
Returns a new instance of EventContext.
24 25 26 27 28 29 30 31 32 |
# File 'lib/workos/shared/event_context.rb', line 24 def initialize(json) hash = self.class.normalize(json) @google_analytics_client_id = hash[:google_analytics_client_id] @google_analytics_sessions = (hash[:google_analytics_sessions] || []).map { |item| item ? WorkOS::EventContextGoogleAnalyticsSession.new(item) : nil } @ajs_anonymous_id = hash[:ajs_anonymous_id] @client_id = hash[:client_id] @actor = hash[:actor] ? WorkOS::EventContextActor.new(hash[:actor]) : nil @previous_attributes = hash[:previous_attributes] || {} end |
Instance Attribute Details
#actor ⇒ Object
Returns the value of attribute actor.
16 17 18 |
# File 'lib/workos/shared/event_context.rb', line 16 def actor @actor end |
#ajs_anonymous_id ⇒ Object
Returns the value of attribute ajs_anonymous_id.
16 17 18 |
# File 'lib/workos/shared/event_context.rb', line 16 def ajs_anonymous_id @ajs_anonymous_id end |
#client_id ⇒ Object
Returns the value of attribute client_id.
16 17 18 |
# File 'lib/workos/shared/event_context.rb', line 16 def client_id @client_id end |
#google_analytics_client_id ⇒ Object
Returns the value of attribute google_analytics_client_id.
16 17 18 |
# File 'lib/workos/shared/event_context.rb', line 16 def google_analytics_client_id @google_analytics_client_id end |
#google_analytics_sessions ⇒ Object
Returns the value of attribute google_analytics_sessions.
16 17 18 |
# File 'lib/workos/shared/event_context.rb', line 16 def google_analytics_sessions @google_analytics_sessions end |
#previous_attributes ⇒ Object
Returns the value of attribute previous_attributes.
16 17 18 |
# File 'lib/workos/shared/event_context.rb', line 16 def previous_attributes @previous_attributes end |