Class: TopsConnect::Property
- Inherits:
-
Base
- Object
- Base
- TopsConnect::Property
show all
- Defined in:
- lib/tops_connect/property.rb
Instance Attribute Summary
Attributes inherited from Base
#data
Instance Method Summary
collapse
Methods inherited from Base
#[], #initialize
Instance Method Details
#account_number ⇒ Object
10
11
12
|
# File 'lib/tops_connect/property.rb', line 10
def account_number
data['AccountNumber']
end
|
#address ⇒ Object
14
15
16
17
18
19
|
# File 'lib/tops_connect/property.rb', line 14
def address
[*address_lines_with_unit_number, city_state_zip]
.map(&:strip)
.select { |line| line.match?(/[[:graph:]]/) }
.join("\n")
end
|
#city_state_zip ⇒ Object
32
33
34
|
# File 'lib/tops_connect/property.rb', line 32
def city_state_zip
"#{property['City']}, #{property['State']} #{property['Zip']}"
end
|
21
22
23
|
# File 'lib/tops_connect/property.rb', line 21
def
data['CommunityKey']
end
|
#modified_date ⇒ Object
Also known as:
updated_at
25
26
27
28
29
|
# File 'lib/tops_connect/property.rb', line 25
def modified_date
return unless data['Metadata']['ModifiedDate']
Time.parse data['Metadata']['ModifiedDate']
end
|
#property_key ⇒ Object
Also known as:
id
5
6
7
|
# File 'lib/tops_connect/property.rb', line 5
def property_key
data['Key']
end
|