Module: RemoteResource::Base::ClassMethods

Defined in:
lib/remote_resource/base.rb

Instance Method Summary collapse

Instance Method Details

#connection_optionsObject



40
41
42
# File 'lib/remote_resource/base.rb', line 40

def connection_options
  RemoteResource::ConnectionOptions.new(self)
end

#threaded_connection_optionsObject



44
45
46
# File 'lib/remote_resource/base.rb', line 44

def threaded_connection_options
  Thread.current[threaded_connection_options_thread_name] ||= {}
end

#with_connection_options(connection_options = {}) ⇒ Object



48
49
50
51
52
53
54
55
# File 'lib/remote_resource/base.rb', line 48

def with_connection_options(connection_options = {})
  begin
    Thread.current[threaded_connection_options_thread_name] = threaded_connection_options.merge(connection_options)
    yield
  ensure
    Thread.current[threaded_connection_options_thread_name] = nil
  end
end