Class: Capybara::RegistrationContainer Private

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/registration_container.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

API:

  • private

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



19
20
21
22
23
24
25
# 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) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



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

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

#[]=(name, value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



14
15
16
17
# 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

#namesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



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

def names
  @registered.keys
end

#respond_to_missing?(method_name, include_all) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

API:

  • private



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

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