Class: LucidIntercom::Attributes

Inherits:
Object
  • Object
show all
Defined in:
lib/lucid_intercom/attributes.rb,
lib/lucid_intercom/attributes/base.rb,
lib/lucid_intercom/attributes/user.rb,
lib/lucid_intercom/attributes/custom.rb,
lib/lucid_intercom/attributes/company.rb

Defined Under Namespace

Classes: Base, Company, Custom, User

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Attributes

Returns a new instance of Attributes.



12
13
14
# File 'lib/lucid_intercom/attributes.rb', line 12

def initialize(*args)
  @args = args
end

Instance Method Details

#companyHash

Returns:

  • (Hash)


35
36
37
# File 'lib/lucid_intercom/attributes.rb', line 35

def company
  Company.new(*@args).()
end

#company_browserHash

Company attributes for browser (expects ‘id’, not ‘company_id’).

Returns:

  • (Hash)


44
45
46
47
48
# File 'lib/lucid_intercom/attributes.rb', line 44

def company_browser
  company2 = company
  company2[:id] = company2.delete(:company_id)
  company2
end

#customHash

Returns:

  • (Hash)


53
54
55
# File 'lib/lucid_intercom/attributes.rb', line 53

def custom
  Custom.new(*@args).()
end

#userHash

Returns:

  • (Hash)


19
20
21
# File 'lib/lucid_intercom/attributes.rb', line 19

def user
  user_browser.reject { |k, _| k == :user_hash }
end

#user_browserHash

User attributes for browser (with ‘user_hash’).

Returns:

  • (Hash)


28
29
30
# File 'lib/lucid_intercom/attributes.rb', line 28

def user_browser
  User.new(*@args).()
end