123456789_123456789_123456789_123456789_123456789_

Class: Bundler::ConnectionPool::Wrapper

Relationships & Source Files
Inherits: BasicObject
Defined in: lib/bundler/vendor/connection_pool/lib/connection_pool.rb

Constant Summary

Class Method Summary

Instance Method Summary

Constructor Details

.new(options = {}, &block) ⇒ Wrapper

[ GitHub ]

  
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool.rb', line 131

def initialize(options = {}, &block)
  @pool = options.fetch(:pool) { ::Bundler::ConnectionPool.new(options, &block) }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block)

[ GitHub ]

  
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool.rb', line 155

def method_missing(name, *args, &block)
  with do |connection|
    connection.send(name, *args, &block)
  end
end

Instance Method Details

#pool_available

[ GitHub ]

  
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool.rb', line 147

def pool_available
  @pool.available
end

#pool_shutdown(&block)

[ GitHub ]

  
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool.rb', line 139

def pool_shutdown(&block)
  @pool.shutdown(&block)
end

#pool_size

[ GitHub ]

  
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool.rb', line 143

def pool_size
  @pool.size
end

#respond_to?(id, *args) ⇒ Boolean

[ GitHub ]

  
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool.rb', line 151

def respond_to?(id, *args)
  METHODS.include?(id) || with { |c| c.respond_to?(id, *args) }
end

#with(&block)

[ GitHub ]

  
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool.rb', line 135

def with(&block)
  @pool.with(&block)
end