lib/etsy.rb in etsy-0.2.3 vs lib/etsy.rb in etsy-0.2.4

- old
+ new

@@ -61,12 +61,27 @@ # module Etsy class Error < RuntimeError; end class << self - attr_accessor :api_key, :api_secret attr_writer :callback_url attr_writer :permission_scopes + end + + # Make Etsy.api_key and Etsy.api_secret thread safe + # + def self.api_key + Thread.current[:etsy_api_key] + end + + def self.api_key=(val) + Thread.current[:etsy_api_key] = val + end + def self.api_secret + Thread.current[:etsy_api_secret] + end + def self.api_secret=(val) + Thread.current[:etsy_api_secret] = val end SANDBOX_HOST = 'sandbox.openapi.etsy.com' PRODUCTION_HOST = 'openapi.etsy.com'