Skip to content

Commit

Permalink
fix: add IP address property to user object (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyiuhc authored Nov 30, 2023
1 parent 7873c35 commit c61403a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/experiment/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class User
# @return [String, nil] the value of dma
attr_accessor :dma

# Predefined field, must be manually provided
# @return [String, nil] the value of ip address
attr_accessor :ip_address

# Predefined field, must be manually provided
# @return [String, nil] the value of language
attr_accessor :language
Expand Down Expand Up @@ -74,6 +78,7 @@ class User
# @param [String, nil] city Predefined field, must be manually provided
# @param [String, nil] region Predefined field, must be manually provided
# @param [String, nil] dma Predefined field, must be manually provided
# @param [String, nil] ip_address Predefined field, must be manually provided
# @param [String, nil] language Predefined field, must be manually provided
# @param [String, nil] platform Predefined field, must be manually provided
# @param [String, nil] version Predefined field, must be manually provided
Expand All @@ -84,7 +89,7 @@ class User
# @param [String, nil] carrier Predefined field, must be manually provided
# @param [String, nil] library Predefined field, auto populated, can be manually overridden
# @param [Hash, nil] user_properties Custom user properties
def initialize(device_id: nil, user_id: nil, country: nil, city: nil, region: nil, dma: nil, language: nil,
def initialize(device_id: nil, user_id: nil, country: nil, city: nil, region: nil, dma: nil, ip_address: nil, language: nil,
platform: nil, version: nil, os: nil, device_manufacturer: nil, device_brand: nil,
device_model: nil, carrier: nil, library: nil, user_properties: nil)
@device_id = device_id
Expand All @@ -93,6 +98,7 @@ def initialize(device_id: nil, user_id: nil, country: nil, city: nil, region: ni
@city = city
@region = region
@dma = dma
@ip_address = ip_address
@language = language
@platform = platform
@version = version
Expand All @@ -115,6 +121,7 @@ def as_json(_options = {})
city: @city,
region: @region,
dma: @dma,
ip_address: @ip_address,
language: @language,
platform: @platform,
version: @version,
Expand Down

0 comments on commit c61403a

Please sign in to comment.