Class: Person

Inherits:
Entity show all
Defined in:
lib/messenger/models/person.rb

Instance Attribute Summary collapse

Attributes inherited from Entity

#id

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Person

Returns a new instance of Person.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/messenger/models/person.rb', line 21

def initialize(json)
  @id = json['id']
  @attachable_sgid = json['attachable_sgid']
  @name = json['name']
  @email_address = json['email_address']
  @personable_type = json['personable_type']
  @title = json['title']
  @bio = json['bio']
  @created_at = Time.parse(json['created_at'])
  @updated_at = Time.parse(json['updated_at'])
  @admin = json['admin']
  @owner = json['owner']
  @time_zone = json['time_zone']
  @avatar_url = json['avatar_url']

  @company = Company.new
  @company.id = json['company']['id']
  @company.name = json['company']['name']
end

Instance Attribute Details

#adminObject

Returns the value of attribute admin.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def admin
  @admin
end

#attachable_sgidObject

Returns the value of attribute attachable_sgid.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def attachable_sgid
  @attachable_sgid
end

#avatar_urlObject

Returns the value of attribute avatar_url.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def avatar_url
  @avatar_url
end

#bioObject

Returns the value of attribute bio.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def bio
  @bio
end

#companyObject

Returns the value of attribute company.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def company
  @company
end

#created_atObject

Returns the value of attribute created_at.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def created_at
  @created_at
end

#email_addressObject

Returns the value of attribute email_address.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def email_address
  @email_address
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def name
  @name
end

#ownerObject

Returns the value of attribute owner.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def owner
  @owner
end

#personable_typeObject

Returns the value of attribute personable_type.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def personable_type
  @personable_type
end

#time_zoneObject

Returns the value of attribute time_zone.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def time_zone
  @time_zone
end

#titleObject

Returns the value of attribute title.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def title
  @title
end

#updated_atObject

Returns the value of attribute updated_at.



7
8
9
# File 'lib/messenger/models/person.rb', line 7

def updated_at
  @updated_at
end