Class: SignalApi::SegmentUser
- Inherits:
-
Object
- Object
- SignalApi::SegmentUser
- Defined in:
- lib/signal_api/segment.rb
Overview
Represents a user to be added to a segment
Instance Attribute Summary collapse
-
#email_address ⇒ Object
readonly
Returns the value of attribute email_address.
-
#mobile_phone ⇒ Object
readonly
Returns the value of attribute mobile_phone.
-
#user_data ⇒ Object
readonly
Returns the value of attribute user_data.
Instance Method Summary collapse
-
#initialize(identifying_attribute, user_data = {}) ⇒ SegmentUser
constructor
Create a new segment on the Signal platform.
Constructor Details
#initialize(identifying_attribute, user_data = {}) ⇒ SegmentUser
Create a new segment on the Signal platform.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/signal_api/segment.rb', line 18 def initialize(, user_data={}) if Phone.valid?() @mobile_phone = elsif EmailAddress.valid?() @email_address = else raise InvalidParameterException.new("identifying_attribute must be a valid mobile phone number or email address") end @user_data = user_data unless user_data.empty? end |
Instance Attribute Details
#email_address ⇒ Object (readonly)
Returns the value of attribute email_address.
11 12 13 |
# File 'lib/signal_api/segment.rb', line 11 def email_address @email_address end |
#mobile_phone ⇒ Object (readonly)
Returns the value of attribute mobile_phone.
11 12 13 |
# File 'lib/signal_api/segment.rb', line 11 def mobile_phone @mobile_phone end |
#user_data ⇒ Object (readonly)
Returns the value of attribute user_data.
11 12 13 |
# File 'lib/signal_api/segment.rb', line 11 def user_data @user_data end |