Class: LucidIntercom::CompanyAttributes

Inherits:
Attributes
  • Object
show all
Defined in:
lib/lucid_intercom/company_attributes.rb

Instance Method Summary collapse

Methods inherited from Attributes

#app_data, #shopify_data

Instance Method Details

#customCompanyCustomAttributes



8
# File 'lib/lucid_intercom/company_attributes.rb', line 8

param :custom, default: -> { CompanyCustomAttributes.new(shopify_data, app_data) }

#to_h(browser: false, convert: Container[:convert]) ⇒ Hash

Parameters:

  • browser (Boolean) (defaults to: false)

    format for browser snippet

  • convert (#call) (defaults to: Container[:convert])

Returns:

  • (Hash)


16
17
18
19
20
21
22
# File 'lib/lucid_intercom/company_attributes.rb', line 16

def to_h(browser: false, convert: Container[:convert])
  convert.({}.tap do |h|
    h[browser ? :id : :company_id] = shopify_data['myshopify_domain']
    h[:name] = shopify_data['name']
    h[:plan] = shopify_data['plan_name']
  end)
end