Class: LucidIntercom::Attributes
- Inherits:
-
Object
- Object
- LucidIntercom::Attributes
- 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
- #company ⇒ Hash
-
#company_browser ⇒ Hash
Company attributes for browser (expects ‘id’, not ‘company_id’).
- #custom ⇒ Hash
-
#initialize(*args) ⇒ Attributes
constructor
A new instance of Attributes.
- #user ⇒ Hash
-
#user_browser ⇒ Hash
User attributes for browser (with ‘user_hash’).
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
#company ⇒ Hash
35 36 37 |
# File 'lib/lucid_intercom/attributes.rb', line 35 def company Company.new(*@args).() end |
#company_browser ⇒ Hash
Company attributes for browser (expects ‘id’, not ‘company_id’).
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 |
#custom ⇒ Hash
53 54 55 |
# File 'lib/lucid_intercom/attributes.rb', line 53 def custom Custom.new(*@args).() end |
#user ⇒ Hash
19 20 21 |
# File 'lib/lucid_intercom/attributes.rb', line 19 def user user_browser.reject { |k, _| k == :user_hash } end |
#user_browser ⇒ Hash
User attributes for browser (with ‘user_hash’).
28 29 30 |
# File 'lib/lucid_intercom/attributes.rb', line 28 def user_browser User.new(*@args).() end |