lib/tops_connect/community.rb in tops_connect-0.1.4 vs lib/tops_connect/community.rb in tops_connect-0.2.0

- old
+ new

@@ -1,20 +1,21 @@ # frozen_string_literal: true module TopsConnect class Community < Base attr_reader :id - def initialize(id, data = nil) - @id = id.to_i + def initialize(client, data = nil) @data = data + + super client end def data @data || reload! end def reload! - @data = get "/community/#{@id}" + @data = get "/community/#{@client.community_id}" end def code data['CommunityID'] end