tops_connect 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f250044f3d5c33e7a4b8433e6750fb35422e8683
4
- data.tar.gz: 20ab62a1141f60cf39cc44895d351a63a3d41046
3
+ metadata.gz: 9ed44b3ea707e7e23717699b06d03c5b553280c7
4
+ data.tar.gz: 08ce4c8758a74bce6468604eaeef765db27176a6
5
5
  SHA512:
6
- metadata.gz: 2bae4df0dabe1b35792326b9cec79b4b13bca9d16dc6d5da5fb2adda2593dd9266c70cae0f54d3a071209d70125f6b9bc9ac303f85dfdd527ae58387de8e8099
7
- data.tar.gz: b30c6c4634f799b2e6049ce6954fd980494f0f09c51664b2e288a0bef1e163945d1af105253cf422e8f56fe86498166f3c738ab811c8d210d44b3d359ebc2bf3
6
+ metadata.gz: 49cc58338ed25e9bb840a08f7c9b1bcd0cfd62ca2b2a80dd64cc59af68611806c79abda10a70fe692d332c66edfc574e2204a1be1478e6d071ed4ef446f47bf9
7
+ data.tar.gz: 467889a07a333198ba4e886b8195cd4d5fbfa0872bb6d57c6b0927190e398078b33e2baef54adf652c005fe5a05e10209bec8d961fef2b1acd27056702afe614
data/lib/tops_connect.rb CHANGED
@@ -7,6 +7,7 @@ require 'tops_connect/communities'
7
7
  require 'tops_connect/owners'
8
8
  require 'tops_connect/properties'
9
9
 
10
+ require 'tops_connect/base'
10
11
  require 'tops_connect/community'
11
12
  require 'tops_connect/owner'
12
13
  require 'tops_connect/property'
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+ module TopsConnect
3
+ class Base
4
+ attr_reader :data
5
+
6
+ def initialize(data)
7
+ @data = data
8
+ end
9
+
10
+ def [](key)
11
+ @data[key]
12
+ end
13
+ end
14
+ end
@@ -1,20 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
  module TopsConnect
3
- class Community
4
- attr_reader :data
5
-
6
- def initialize(data)
7
- @data = data
8
- end
9
-
10
- def id
3
+ class Community < Base
4
+ def community_key
11
5
  data['CommunityKey']
12
6
  end
13
- alias community_key id
7
+ alias id community_key
14
8
 
15
- def code
9
+ def community_id
16
10
  data['CommunityID']
17
11
  end
12
+ alias code community_id
18
13
 
19
14
  def name
20
15
  data['Name']
@@ -36,11 +31,11 @@ module TopsConnect
36
31
  DateTime.parse data['LastSyncTime'] if data['LastSyncTime']
37
32
  end
38
33
 
39
- def updated_at
34
+ def modified_date
40
35
  return unless data['Metadata']['ModifiedDate']
41
36
 
42
37
  DateTime.parse data['Metadata']['ModifiedDate']
43
38
  end
44
- alias modified_date updated_at
39
+ alias updated_at modified_date
45
40
  end
46
41
  end
@@ -1,16 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
  module TopsConnect
3
- class Owner
4
- attr_reader :data
5
-
6
- def initialize(data)
7
- @data = data
8
- end
9
-
10
- def id
3
+ class Owner < Base
4
+ def owner_key
11
5
  data['OwnerKey']
12
6
  end
13
- alias owner_key id
7
+ alias id owner_key
14
8
 
15
9
  def alternate_mailing_addresses
16
10
  [1, 2].map do |n|
@@ -32,11 +26,11 @@ module TopsConnect
32
26
  end.compact
33
27
  end
34
28
 
35
- def property_id
29
+ def property_key
36
30
  data['PropertyKey']
37
31
  end
38
32
 
39
- def community_id
33
+ def community_key
40
34
  data['CommunityKey']
41
35
  end
42
36
 
@@ -1,16 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
  module TopsConnect
3
- class Property
4
- attr_reader :data
5
-
6
- def initialize(data)
7
- @data = data
8
- end
9
-
10
- def id
3
+ class Property < Base
4
+ def property_key
11
5
  data['PropertyKey']
12
6
  end
13
- alias property_key id
7
+ alias id property_key
14
8
 
15
9
  def account_number
16
10
  data['AccountNumber']
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module TopsConnect
3
- VERSION = '0.3.1'
3
+ VERSION = '0.3.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tops_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Hoffman
@@ -97,6 +97,7 @@ files:
97
97
  - bin/console
98
98
  - bin/setup
99
99
  - lib/tops_connect.rb
100
+ - lib/tops_connect/base.rb
100
101
  - lib/tops_connect/client.rb
101
102
  - lib/tops_connect/communities.rb
102
103
  - lib/tops_connect/community.rb