tops_connect 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tops_connect/client.rb +1 -0
- data/lib/tops_connect/communities.rb +18 -3
- data/lib/tops_connect/community.rb +8 -24
- data/lib/tops_connect/owner.rb +13 -25
- data/lib/tops_connect/owners.rb +25 -9
- data/lib/tops_connect/properties.rb +20 -0
- data/lib/tops_connect/property.rb +54 -0
- data/lib/tops_connect/version.rb +1 -1
- data/lib/tops_connect.rb +2 -0
- metadata +4 -3
- data/lib/tops_connect/base.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4848a6dc16bda8501057fd0279bfe1b4422c6f5d
|
4
|
+
data.tar.gz: 9deec64df62077a039d0c5d70f4632d15538e3e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a100cdb062f92be4e637447cd1bda59a8a7be1327b2a88c8daffb9ed2ee894e6702d1162403119a495ee48648e21978161f8152d838849bb6482d338a701962
|
7
|
+
data.tar.gz: 7754b43cc9ce16ea0509023f0d4db2ee9e0620513ef733cf1902c5aeb6c739b22872b1de0dc3953b658ef0d6dba69aeb7e14e71d5a8400881a739f1004ff5a17
|
data/lib/tops_connect/client.rb
CHANGED
@@ -3,16 +3,31 @@ module TopsConnect
|
|
3
3
|
module Communities
|
4
4
|
# Method: GET
|
5
5
|
# Endpoint: Community_GetList
|
6
|
-
# Returns: Array<
|
6
|
+
# Returns: Array<TopsConnect::Community>
|
7
7
|
def communities
|
8
|
-
get('/community')
|
8
|
+
get('/community').map do |community_data|
|
9
|
+
TopsConnect::Community.new community_data
|
10
|
+
end
|
9
11
|
end
|
10
12
|
|
11
13
|
# Method: GET
|
12
14
|
# Endpoint: Community_Get
|
13
15
|
# Returns: TopsConnect::Community
|
14
16
|
def community
|
15
|
-
TopsConnect::Community.new
|
17
|
+
TopsConnect::Community.new get("/community/#{@community_id}")
|
18
|
+
end
|
19
|
+
|
20
|
+
# Method: GET
|
21
|
+
# Endpoint: ChargeCode_GetList
|
22
|
+
# Returns: Array<Hash>
|
23
|
+
def charge_codes
|
24
|
+
get('/chargecode').map do |charge_code|
|
25
|
+
{
|
26
|
+
key: charge_code['ChargeCodeKey'],
|
27
|
+
code: charge_code['Code'],
|
28
|
+
description: charge_code['Description']
|
29
|
+
}
|
30
|
+
end
|
16
31
|
end
|
17
32
|
end
|
18
33
|
end
|
@@ -1,21 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module TopsConnect
|
3
|
-
class Community
|
4
|
-
attr_reader :
|
3
|
+
class Community
|
4
|
+
attr_reader :data
|
5
5
|
|
6
|
-
def initialize(
|
6
|
+
def initialize(data)
|
7
7
|
@data = data
|
8
|
-
|
9
|
-
super client
|
10
|
-
end
|
11
|
-
|
12
|
-
def data
|
13
|
-
@data || reload!
|
14
8
|
end
|
15
9
|
|
16
|
-
def
|
17
|
-
|
10
|
+
def id
|
11
|
+
data['CommunityKey']
|
18
12
|
end
|
13
|
+
alias community_key id
|
19
14
|
|
20
15
|
def code
|
21
16
|
data['CommunityID']
|
@@ -42,21 +37,10 @@ module TopsConnect
|
|
42
37
|
end
|
43
38
|
|
44
39
|
def updated_at
|
45
|
-
return
|
40
|
+
return unless data['Metadata']['ModifiedDate']
|
46
41
|
|
47
42
|
DateTime.parse data['Metadata']['ModifiedDate']
|
48
43
|
end
|
49
|
-
|
50
|
-
# Method: GET
|
51
|
-
# Endpoint: ChargeCode_GetList
|
52
|
-
def charge_codes
|
53
|
-
get('/chargecode').map do |charge_code|
|
54
|
-
{
|
55
|
-
key: charge_code['ChargeCodeKey'],
|
56
|
-
code: charge_code['Code'],
|
57
|
-
description: charge_code['Description']
|
58
|
-
}
|
59
|
-
end
|
60
|
-
end
|
44
|
+
alias modified_date updated_at
|
61
45
|
end
|
62
46
|
end
|
data/lib/tops_connect/owner.rb
CHANGED
@@ -1,22 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module TopsConnect
|
3
|
-
class Owner
|
4
|
-
attr_reader :
|
3
|
+
class Owner
|
4
|
+
attr_reader :data
|
5
5
|
|
6
|
-
def initialize(
|
7
|
-
@id = id.to_i
|
6
|
+
def initialize(data)
|
8
7
|
@data = data
|
9
|
-
|
10
|
-
super client
|
11
|
-
end
|
12
|
-
|
13
|
-
def data
|
14
|
-
@data || reload!
|
15
8
|
end
|
16
9
|
|
17
|
-
def
|
18
|
-
|
10
|
+
def id
|
11
|
+
data['OwnerKey']
|
19
12
|
end
|
13
|
+
alias owner_key id
|
20
14
|
|
21
15
|
def alternate_mailing_addresses
|
22
16
|
[1, 2].map do |n|
|
@@ -71,6 +65,8 @@ module TopsConnect
|
|
71
65
|
end
|
72
66
|
|
73
67
|
def updated_at
|
68
|
+
return unless data['Metadata']['ModifiedDate']
|
69
|
+
|
74
70
|
DateTime.parse data['Metadata']['ModifiedDate']
|
75
71
|
end
|
76
72
|
|
@@ -83,23 +79,15 @@ module TopsConnect
|
|
83
79
|
end
|
84
80
|
|
85
81
|
def move_out_date
|
86
|
-
|
87
|
-
end
|
82
|
+
return unless data['MoveOutDate']
|
88
83
|
|
89
|
-
|
90
|
-
DateTime.parse data['SettlementDate'] if data['SettlementDate']
|
84
|
+
DateTime.parse data['MoveOutDate']
|
91
85
|
end
|
92
86
|
|
93
|
-
|
94
|
-
|
95
|
-
def balance
|
96
|
-
get "/balance/#{@id}"
|
97
|
-
end
|
87
|
+
def settlement_date
|
88
|
+
return unless data['SettlementDate']
|
98
89
|
|
99
|
-
|
100
|
-
# Endpoint: Charge_Get
|
101
|
-
def charges
|
102
|
-
get "/charge/#{@id}"
|
90
|
+
DateTime.parse data['SettlementDate']
|
103
91
|
end
|
104
92
|
end
|
105
93
|
end
|
data/lib/tops_connect/owners.rb
CHANGED
@@ -1,21 +1,37 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module TopsConnect
|
3
3
|
module Owners
|
4
|
+
# Method: GET
|
5
|
+
# Endpoint: Owner_GetList
|
6
|
+
# Returns: Array<TopsConnect::Owner>
|
7
|
+
def owners(property_key = nil)
|
8
|
+
query = {}
|
9
|
+
query['PropertyKey'] = property_key.to_i if property_key
|
10
|
+
|
11
|
+
get('/owner', query: query).map do |owner_data|
|
12
|
+
TopsConnect::Owner.new owner_data
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
4
16
|
# Method: GET
|
5
17
|
# Endpoint: Owner_Get
|
6
|
-
|
7
|
-
|
18
|
+
# Returns: TopsConnect::Owner
|
19
|
+
def owner(owner_key)
|
20
|
+
TopsConnect::Owner.new get("/owner/#{owner_key}")
|
8
21
|
end
|
9
22
|
|
10
23
|
# Method: GET
|
11
|
-
# Endpoint:
|
12
|
-
|
13
|
-
|
14
|
-
|
24
|
+
# Endpoint: Balance_Get
|
25
|
+
# Returns: Hash
|
26
|
+
def balance(owner_key)
|
27
|
+
get "/balance/#{owner_key}"
|
28
|
+
end
|
15
29
|
|
16
|
-
|
17
|
-
|
18
|
-
|
30
|
+
# Method: GET
|
31
|
+
# Endpoint: Charge_Get
|
32
|
+
# Returns: Hash
|
33
|
+
def charges(owner_key)
|
34
|
+
get "/charge/#{owner_key}"
|
19
35
|
end
|
20
36
|
end
|
21
37
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module TopsConnect
|
3
|
+
module Properties
|
4
|
+
# Method: GET
|
5
|
+
# Endpoint: Property_GetList
|
6
|
+
# Returns: Array<TopsConnect::Property>
|
7
|
+
def properties
|
8
|
+
get('/property').map do |property_data|
|
9
|
+
TopsConnect::Property.new property_data
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# Method: GET
|
14
|
+
# Endpoint: Property_Get
|
15
|
+
# Returns: TopsConnect::Property
|
16
|
+
def property(property_key)
|
17
|
+
TopsConnect::Property.new get("/property/#{property_key}")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module TopsConnect
|
3
|
+
class Property
|
4
|
+
attr_reader :data
|
5
|
+
|
6
|
+
def initialize(data)
|
7
|
+
@data = data
|
8
|
+
end
|
9
|
+
|
10
|
+
def id
|
11
|
+
data['PropertyKey']
|
12
|
+
end
|
13
|
+
alias property_key id
|
14
|
+
|
15
|
+
def account_number
|
16
|
+
data['AccountNumber']
|
17
|
+
end
|
18
|
+
|
19
|
+
def address
|
20
|
+
"#{data['AddressNumber']} #{data['Street']}"
|
21
|
+
end
|
22
|
+
|
23
|
+
def city
|
24
|
+
data['City']
|
25
|
+
end
|
26
|
+
|
27
|
+
def state
|
28
|
+
data['State']
|
29
|
+
end
|
30
|
+
|
31
|
+
def address_number
|
32
|
+
data['AddressNumber']
|
33
|
+
end
|
34
|
+
|
35
|
+
def street
|
36
|
+
data['Street']
|
37
|
+
end
|
38
|
+
|
39
|
+
def zip
|
40
|
+
data['Zip']
|
41
|
+
end
|
42
|
+
|
43
|
+
def community_key
|
44
|
+
data['CommunityKey']
|
45
|
+
end
|
46
|
+
|
47
|
+
def updated_at
|
48
|
+
return unless data['Metadata']['ModifiedDate']
|
49
|
+
|
50
|
+
DateTime.parse data['Metadata']['ModifiedDate']
|
51
|
+
end
|
52
|
+
alias modified_date updated_at
|
53
|
+
end
|
54
|
+
end
|
data/lib/tops_connect/version.rb
CHANGED
data/lib/tops_connect.rb
CHANGED
@@ -5,10 +5,12 @@ require 'json'
|
|
5
5
|
|
6
6
|
require 'tops_connect/communities'
|
7
7
|
require 'tops_connect/owners'
|
8
|
+
require 'tops_connect/properties'
|
8
9
|
|
9
10
|
require 'tops_connect/base'
|
10
11
|
require 'tops_connect/community'
|
11
12
|
require 'tops_connect/owner'
|
13
|
+
require 'tops_connect/property'
|
12
14
|
|
13
15
|
require 'tops_connect/configuration'
|
14
16
|
require 'tops_connect/client'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tops_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Hoffman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,13 +97,14 @@ files:
|
|
97
97
|
- bin/console
|
98
98
|
- bin/setup
|
99
99
|
- lib/tops_connect.rb
|
100
|
-
- lib/tops_connect/base.rb
|
101
100
|
- lib/tops_connect/client.rb
|
102
101
|
- lib/tops_connect/communities.rb
|
103
102
|
- lib/tops_connect/community.rb
|
104
103
|
- lib/tops_connect/configuration.rb
|
105
104
|
- lib/tops_connect/owner.rb
|
106
105
|
- lib/tops_connect/owners.rb
|
106
|
+
- lib/tops_connect/properties.rb
|
107
|
+
- lib/tops_connect/property.rb
|
107
108
|
- lib/tops_connect/version.rb
|
108
109
|
- tops_connect.gemspec
|
109
110
|
homepage: https://github.com/ValenciaMgmt/tops_connect
|