123456789_123456789_123456789_123456789_123456789_

Class: Capybara::RegistrationContainer Private

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: lib/capybara/registration_container.rb

Class Method Summary

Instance Method Summary

Constructor Details

.newRegistrationContainer (private)

[ GitHub ]

  
# File 'lib/capybara/registration_container.rb', line 33

def initialize
  @registered = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name)

[ GitHub ]

  
# File 'lib/capybara/registration_container.rb', line 19

def method_missing(method_name, ...)
  if @registered.respond_to?(method_name)
    Capybara::Helpers.warn "DEPRECATED: Calling '#{method_name}' on the drivers/servers container is deprecated without replacement"
    return @registered.public_send(method_name, ...)
  end
  super
end

Instance Method Details

#[](name)

[ GitHub ]

  
# File 'lib/capybara/registration_container.rb', line 10

def [](name)
  @registered[name]
end

#[]=(name, value)

[ GitHub ]

  
# File 'lib/capybara/registration_container.rb', line 14

def []=(name, value)
  Capybara::Helpers.warn 'DEPRECATED: Directly setting drivers/servers is deprecated, please use Capybara.register_driver/register_server instead'
  @registered[name] = value
end

#names

[ GitHub ]

  
# File 'lib/capybara/registration_container.rb', line 6

def names
  @registered.keys
end

#register(name, block) (private)

[ GitHub ]

  
# File 'lib/capybara/registration_container.rb', line 37

def register(name, block)
  @registered[name] = block
end

#respond_to_missing?(method_name, include_all) ⇒ Boolean

[ GitHub ]

  
# File 'lib/capybara/registration_container.rb', line 27

def respond_to_missing?(method_name, include_all)
  @registered.respond_to?(method_name) || super
end