Class: LucidIntercom::CompanyAttributes

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

Instance Method Summary collapse

Methods inherited from Attributes

#shopify_data

Instance Method Details

#to_h(browser: false, convert: Convert.new) ⇒ Hash

Parameters:

  • browser (Boolean) (defaults to: false)

    format for browser snippet

  • convert (#call) (defaults to: Convert.new)

Returns:

  • (Hash)


13
14
15
16
17
18
19
# File 'lib/lucid_intercom/company_attributes.rb', line 13

def to_h(browser: false, convert: Convert.new)
  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