Class: CapybaraSelenium::Server::Configurator

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara_selenium/server/configurator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Configurator

Returns a new instance of Configurator.



6
7
8
# File 'lib/capybara_selenium/server/configurator.rb', line 6

def initialize(config)
  @config = config
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &_) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/capybara_selenium/server/configurator.rb', line 15

def method_missing(method, *args, &_)
  if @config.respond_to? method
    if method =~ /(.*)=/
      return @config.send method, args.first
    else
      return @config.send method
    end
  else
    fail
  end
end

Instance Attribute Details

#config ⇒ Object

Returns the value of attribute config.



4
5
6
# File 'lib/capybara_selenium/server/configurator.rb', line 4

def config
  @config
end

Instance Method Details

#configure(&block) ⇒ Object



10
11
12
13
# File 'lib/capybara_selenium/server/configurator.rb', line 10

def configure(&block)
  @config = create_config
  block.call @config
end