Class: AmplitudeAPI::Identification
- Inherits:
-
Object
- Object
- AmplitudeAPI::Identification
- Defined in:
- lib/amplitude_api/identification.rb
Overview
AmplitudeAPI::Identification
Instance Attribute Summary collapse
-
#user_id ⇒ String
The user_id to be sent to Amplitude.
-
#user_properties ⇒ String
The user_properties to be attached to the Amplitude Identify.
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Compares +to_hash+ for equality.
-
#initialize(user_id: '', user_properties: {}) ⇒ Identification
constructor
Create a new Identification.
-
#to_hash ⇒ Hash
Used for serialization and comparison.
Constructor Details
#initialize(user_id: '', user_properties: {}) ⇒ Identification
Create a new Identification
15 16 17 18 |
# File 'lib/amplitude_api/identification.rb', line 15 def initialize(user_id: '', user_properties: {}) self.user_id = user_id self.user_properties = user_properties end |
Instance Attribute Details
#user_id ⇒ String
Returns the user_id to be sent to Amplitude.
6 7 8 |
# File 'lib/amplitude_api/identification.rb', line 6 def user_id @user_id end |
#user_properties ⇒ String
Returns the user_properties to be attached to the Amplitude Identify.
9 10 11 |
# File 'lib/amplitude_api/identification.rb', line 9 def user_properties @user_properties end |
Instance Method Details
#==(other) ⇒ true, false
Compares +to_hash+ for equality
42 43 44 45 46 47 48 |
# File 'lib/amplitude_api/identification.rb', line 42 def ==(other) if other.respond_to?(:to_hash) to_hash == other.to_hash else false end end |
#to_hash ⇒ Hash
Used for serialization and comparison
32 33 34 35 36 37 |
# File 'lib/amplitude_api/identification.rb', line 32 def to_hash { user_id: user_id, user_properties: user_properties } end |