lib/govdelivery/tms/client.rb in govdelivery-tms-0.8.8 vs lib/govdelivery/tms/client.rb in govdelivery-tms-0.8.9

- old
+ new

@@ -2,11 +2,11 @@ # The client class to connect and talk to the TMS REST API. class GovDelivery::TMS::Client include GovDelivery::TMS::Util::HalLinkParser include GovDelivery::TMS::CoreExt - attr_accessor :connection, :href, :api_root, :logger + attr_accessor :connection, :href, :api_root, :logger, :sid DEFAULTS = { api_root: 'https://tms.govdelivery.com', logger: nil }.freeze # Create a new client and issue a request for the available resources for a given account. # @@ -33,9 +33,10 @@ self.connection = GovDelivery::TMS::Connection.new({ auth_token: auth_token, api_root: api_root, logger: logger }.merge!(options)) end def discover! services = get('/').body + self.sid = services['sid'] parse_links(services['_links']) end def get(href) response = raw_connection.get(href)