tops_connect 0.1.3 → 0.1.4
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.rb +1 -0
- data/lib/tops_connect/communities.rb +4 -2
- data/lib/tops_connect/community.rb +61 -0
- data/lib/tops_connect/owner.rb +5 -1
- data/lib/tops_connect/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88806cf795346b8b63cbf0ea928fed4f6605b5df
|
4
|
+
data.tar.gz: 1dc68fd22180ba05ec4b12ddabe2d480149fd8ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e46fe7e62ec1b245523965b72f1d87ad8f4e8b72e9fbc9843b649b4bf84ed4d017734d825cf7429801f2144f0a0a94272d4b0552aef04f1541de52d28c7553dd
|
7
|
+
data.tar.gz: 56e3910e297e441ecf19430ad9c35a364f546e32afdf6e04628c46de0204c9fd46c3a4d6528fbff0e2d5474974b68520d36ebff6da85d1806238c6da94abd32f
|
data/lib/tops_connect.rb
CHANGED
@@ -4,13 +4,15 @@ module TopsConnect
|
|
4
4
|
# Method: GET
|
5
5
|
# Endpoint: Community_GetList
|
6
6
|
def communities
|
7
|
-
get
|
7
|
+
get('/community').map do |community|
|
8
|
+
TopsConnect::Community.new community['CommunityKey'], community
|
9
|
+
end
|
8
10
|
end
|
9
11
|
|
10
12
|
# Method: GET
|
11
13
|
# Endpoint: Community_Get
|
12
14
|
def community(community_id)
|
13
|
-
|
15
|
+
TopsConnect::Community.new community_id
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module TopsConnect
|
3
|
+
class Community < Base
|
4
|
+
attr_reader :id
|
5
|
+
|
6
|
+
def initialize(id, data = nil)
|
7
|
+
@id = id.to_i
|
8
|
+
@data = data
|
9
|
+
end
|
10
|
+
|
11
|
+
def data
|
12
|
+
@data || reload!
|
13
|
+
end
|
14
|
+
|
15
|
+
def reload!
|
16
|
+
@data = get "/community/#{@id}"
|
17
|
+
end
|
18
|
+
|
19
|
+
def code
|
20
|
+
data['CommunityID']
|
21
|
+
end
|
22
|
+
|
23
|
+
def name
|
24
|
+
data['Name']
|
25
|
+
end
|
26
|
+
|
27
|
+
def city
|
28
|
+
data['DefaultCity']
|
29
|
+
end
|
30
|
+
|
31
|
+
def state
|
32
|
+
data['DefaultState']
|
33
|
+
end
|
34
|
+
|
35
|
+
def zip
|
36
|
+
data['DefaultZip']
|
37
|
+
end
|
38
|
+
|
39
|
+
def last_synced_at
|
40
|
+
DateTime.parse data['LastSyncTime'] if data['LastSyncTime']
|
41
|
+
end
|
42
|
+
|
43
|
+
def updated_at
|
44
|
+
return nil unless data['Metadata']['ModifiedDate']
|
45
|
+
|
46
|
+
DateTime.parse data['Metadata']['ModifiedDate']
|
47
|
+
end
|
48
|
+
|
49
|
+
# Method: GET
|
50
|
+
# Endpoint: ChargeCode_GetList
|
51
|
+
def charge_codes
|
52
|
+
get('/chargecode').map do |charge_code|
|
53
|
+
{
|
54
|
+
key: charge_code['ChargeCodeKey'],
|
55
|
+
code: charge_code['Code'],
|
56
|
+
description: charge_code['Description']
|
57
|
+
}
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
data/lib/tops_connect/owner.rb
CHANGED
data/lib/tops_connect/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.4
|
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-04-
|
11
|
+
date: 2016-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- lib/tops_connect/base.rb
|
101
101
|
- lib/tops_connect/client.rb
|
102
102
|
- lib/tops_connect/communities.rb
|
103
|
+
- lib/tops_connect/community.rb
|
103
104
|
- lib/tops_connect/configuration.rb
|
104
105
|
- lib/tops_connect/owner.rb
|
105
106
|
- lib/tops_connect/owners.rb
|