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
13
14
15
|
# File 'lib/tops_connect/property.rb', line 13
def account_number
data['AccountNumber']
end
|
#address ⇒ Object
17
18
19
20
21
22
|
# File 'lib/tops_connect/property.rb', line 17
def address
[*address_lines_with_unit_number, city_state_zip]
.map(&:strip)
.select { |line| line.match?(/[[:graph:]]/) }
.join("\n")
end
|
#city_state_zip ⇒ Object
35
36
37
|
# File 'lib/tops_connect/property.rb', line 35
def city_state_zip
"#{property['City']}, #{property['State']} #{property['Zip']}"
end
|
24
25
26
|
# File 'lib/tops_connect/property.rb', line 24
def
data['CommunityKey']
end
|
#modified_date ⇒ Object
Also known as:
updated_at
28
29
30
31
32
|
# File 'lib/tops_connect/property.rb', line 28
def modified_date
return unless data['Metadata']['ModifiedDate']
Time.parse data['Metadata']['ModifiedDate']
end
|
#property_key ⇒ Object
Also known as:
id
8
9
10
|
# File 'lib/tops_connect/property.rb', line 8
def property_key
data['Key']
end
|