lib/fluxx/resource.rb in fluxx-0.1.3 vs lib/fluxx/resource.rb in fluxx-0.1.4
- old
+ new
@@ -15,9 +15,19 @@
]
endpoint ENV['FLUXX_INSTANCE_URL']
content_type 'application/json'
+ # Defines the client endpoint. Thread-safe.
+ #
+ # @param value [String] the endpoint URI.
+ # @return [String]
+ def endpoint(value = nil)
+ return super(value) unless value.nil?
+
+ Thread.current.thread_variable_get(:FLUXX_INSTANCE_URL) || super
+ end
+
# Updated request handler with the auto-refreshing token authentication
#
# @param payload [Hash] request payload.
# @return [HTTP::Response] instance.
def self.request(*args)