Class: TopsConnect::Owner
- Inherits:
-
Base
- Object
- Base
- TopsConnect::Owner
show all
- Defined in:
- lib/tops_connect/owner.rb
Instance Attribute Summary
Attributes inherited from Base
#data
Instance Method Summary
collapse
Methods inherited from Base
#[], #initialize
Instance Method Details
#alternate_mailing_addresses ⇒ Object
10
11
12
13
14
15
|
# File 'lib/tops_connect/owner.rb', line 10
def alternate_mailing_addresses
data['Addresses']
.select { |row| row['Type']['Name'] == 'Alternate' }
.map { |row| offsite_address(row) }
.compact
end
|
#alternate_name ⇒ Object
29
30
31
|
# File 'lib/tops_connect/owner.rb', line 29
def alternate_name
data['AlternateName']
end
|
#alternate_phone ⇒ Object
39
40
41
42
43
|
# File 'lib/tops_connect/owner.rb', line 39
def alternate_phone
phone = data['Phones'].find { |row| row['Type']['Name'] == 'Alternate' }
phone['PhoneNumber'] if phone
end
|
21
22
23
|
# File 'lib/tops_connect/owner.rb', line 21
def
data['CommunityKey']
end
|
#fax ⇒ Object
45
46
47
48
49
|
# File 'lib/tops_connect/owner.rb', line 45
def fax
phone = data['Phones'].find { |row| row['Type']['Name'] == 'Fax' }
phone['PhoneNumber'] if phone
end
|
#hold_collection? ⇒ Boolean
87
88
89
|
# File 'lib/tops_connect/owner.rb', line 87
def hold_collection?
data['Metadata']['HoldCollection']
end
|
#hold_payment? ⇒ Boolean
83
84
85
|
# File 'lib/tops_connect/owner.rb', line 83
def hold_payment?
data['Metadata']['HoldPayment']
end
|
#home_phone ⇒ Object
33
34
35
36
37
|
# File 'lib/tops_connect/owner.rb', line 33
def home_phone
phone = data['Phones'].find { |row| row['Type']['Name'] == 'Home' }
phone['PhoneNumber'] if phone
end
|
#legal_name ⇒ Object
25
26
27
|
# File 'lib/tops_connect/owner.rb', line 25
def legal_name
data['LegalName']
end
|
#move_out_date ⇒ Object
71
72
73
74
75
|
# File 'lib/tops_connect/owner.rb', line 71
def move_out_date
return unless data['MoveOutDate']
Time.parse data['MoveOutDate']
end
|
#owner? ⇒ Boolean
63
64
65
|
# File 'lib/tops_connect/owner.rb', line 63
def owner?
data['ResidentType'] == 'Owner'
end
|
#owner_key ⇒ Object
Also known as:
id
5
6
7
|
# File 'lib/tops_connect/owner.rb', line 5
def owner_key
data['Key']
end
|
#property_key ⇒ Object
17
18
19
|
# File 'lib/tops_connect/owner.rb', line 17
def property_key
data['PropertyKey']
end
|
#settlement_date ⇒ Object
77
78
79
80
81
|
# File 'lib/tops_connect/owner.rb', line 77
def settlement_date
return unless data['SettlementDate']
Time.parse data['SettlementDate']
end
|
#tenant? ⇒ Boolean
67
68
69
|
# File 'lib/tops_connect/owner.rb', line 67
def tenant?
data['ResidentType'] == 'Tenant'
end
|
#tops_id ⇒ Object
The internal key used by Tops Pro - property number, homeowner type, owner number in the format PPPPPPTOOO.
93
94
95
|
# File 'lib/tops_connect/owner.rb', line 93
def tops_id
data['Metadata']['TopsId']
end
|
#updated_at ⇒ Object
57
58
59
60
61
|
# File 'lib/tops_connect/owner.rb', line 57
def updated_at
return unless data['Metadata']['ModifiedDate']
Time.parse data['Metadata']['ModifiedDate']
end
|
#work_phone ⇒ Object
51
52
53
54
55
|
# File 'lib/tops_connect/owner.rb', line 51
def work_phone
phone = data['Phones'].find { |row| row['Type']['Name'] == 'Work' }
phone['PhoneNumber'] if phone
end
|