Class: LucidIntercom::UserAttributes
- Inherits:
-
Attributes
- Object
- Attributes
- LucidIntercom::UserAttributes
- Defined in:
- lib/lucid_intercom/user_attributes.rb
Instance Method Summary collapse
- #id ⇒ String
-
#id_key ⇒ Symbol
Either :user_id or :email.
- #to_h(browser: false, convert: Convert.new) ⇒ Hash
Methods inherited from Attributes
Instance Method Details
#id ⇒ String
34 35 36 |
# File 'lib/lucid_intercom/user_attributes.rb', line 34 def id shopify_data[id_key.to_s] end |
#id_key ⇒ Symbol
Either :user_id or :email. Currently, we are using the email address.
27 28 29 |
# File 'lib/lucid_intercom/user_attributes.rb', line 27 def id_key :email end |
#to_h(browser: false, convert: Convert.new) ⇒ Hash
14 15 16 17 18 19 20 |
# File 'lib/lucid_intercom/user_attributes.rb', line 14 def to_h(browser: false, convert: Convert.new) convert.({}.tap do |h| h[:user_hash] = user_hash(id) if browser # or myshopify_domain h[:email] = shopify_data['email'] h[:name] = shopify_data['shop_owner'] end) end |