Class: LucidIntercom::UserAttributes
- Inherits:
-
Attributes
- Object
- Attributes
- LucidIntercom::UserAttributes
- Defined in:
- lib/lucid_intercom/user_attributes.rb
Instance Method Summary collapse
- #company ⇒ CompanyAttributes
- #id ⇒ String
-
#id_key ⇒ Symbol
Either :user_id or :email.
- #to_h(browser: false, convert: Container[:convert]) ⇒ Hash
Methods inherited from Attributes
Instance Method Details
#company ⇒ CompanyAttributes
8 |
# File 'lib/lucid_intercom/user_attributes.rb', line 8 param :company, default: -> { CompanyAttributes.new(shopify_data, app_data) } |
#id ⇒ String
36 37 38 |
# File 'lib/lucid_intercom/user_attributes.rb', line 36 def id shopify_data[id_key.to_s] end |
#id_key ⇒ Symbol
Either :user_id or :email. Currently, we are using the email address.
29 30 31 |
# File 'lib/lucid_intercom/user_attributes.rb', line 29 def id_key :email end |
#to_h(browser: false, convert: Container[:convert]) ⇒ Hash
16 17 18 19 20 21 22 |
# File 'lib/lucid_intercom/user_attributes.rb', line 16 def to_h(browser: false, convert: Container[:convert]) 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 |