lib/tops_connect/community.rb in tops_connect-0.3.1 vs lib/tops_connect/community.rb in tops_connect-0.3.2
- old
+ new
@@ -1,22 +1,17 @@
# frozen_string_literal: true
module TopsConnect
- class Community
- attr_reader :data
-
- def initialize(data)
- @data = data
- end
-
- def id
+ class Community < Base
+ def community_key
data['CommunityKey']
end
- alias community_key id
+ alias id community_key
- def code
+ def community_id
data['CommunityID']
end
+ alias code community_id
def name
data['Name']
end
@@ -34,13 +29,13 @@
def last_synced_at
DateTime.parse data['LastSyncTime'] if data['LastSyncTime']
end
- def updated_at
+ def modified_date
return unless data['Metadata']['ModifiedDate']
DateTime.parse data['Metadata']['ModifiedDate']
end
- alias modified_date updated_at
+ alias updated_at modified_date
end
end