Module: Capybara::AsyncRunner::Commands::Configuration::ClassMethods

Defined in:
lib/capybara/async_runner/commands/configuration.rb

Instance Method Summary collapse

Instance Method Details

#command_nameString, Symbol

Returns configured command name or raises error

Returns:

  • (String, Symbol)

Raises:

  • NotImplementedError



23
24
25
26
# File 'lib/capybara/async_runner/commands/configuration.rb', line 23

def command_name
  store[:command_name] or
    raise NotImplementedError, "You need to define self.command_name = ... in #{self}"
end

#command_name=(command_name) ⇒ Object

Saves provided command_name

Parameters:

  • command_name (String)


32
33
34
# File 'lib/capybara/async_runner/commands/configuration.rb', line 32

def command_name=(command_name)
  store[:command_name] = command_name
end

#file_to_runString, Symbol

Returns configured filepath or raises error

Returns:

  • (String, Symbol)

Raises:

  • NotImplementedError



42
43
44
45
# File 'lib/capybara/async_runner/commands/configuration.rb', line 42

def file_to_run
  store[:file_to_run] or
    raise NotImplementedError, "You need to define self.file_to_run = ... in #{self}"
end

#file_to_run=(file_to_run) ⇒ Object

Stores provided relative file_to_run (don’t include directory and extension)

Parameters:

  • file_to_run (String)


51
52
53
# File 'lib/capybara/async_runner/commands/configuration.rb', line 51

def file_to_run=(file_to_run)
  store[:file_to_run] = file_to_run
end

#inherited(klass) ⇒ Object

Inherits all configuration from parent



59
60
61
62
63
64
# File 'lib/capybara/async_runner/commands/configuration.rb', line 59

def inherited(klass)
  super
  return if self == Capybara::AsyncRunner::Command
  klass.command_name = self.command_name
  klass.file_to_run = self.file_to_run
end