Class: AppTester::Options Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/app-tester/options.rb

Overview

This class is abstract.

Framework options

TODO:

implement connection retries

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptions

Returns a new instance of Options.



14
15
16
17
18
19
# File 'lib/app-tester/options.rb', line 14

def initialize
  @environments = {}
  @default_environment = nil
  @log_connections = false
  @default_options = []
end

Instance Attribute Details

#default_environmentObject

Returns the value of attribute default_environment.



9
10
11
# File 'lib/app-tester/options.rb', line 9

def default_environment
  @default_environment
end

#default_optionsObject

Returns the value of attribute default_options.



12
13
14
# File 'lib/app-tester/options.rb', line 12

def default_options
  @default_options
end

#environmentsObject

Returns the value of attribute environments.



11
12
13
# File 'lib/app-tester/options.rb', line 11

def environments
  @environments
end

#log_connectionsObject

Returns the value of attribute log_connections.



10
11
12
# File 'lib/app-tester/options.rb', line 10

def log_connections
  @log_connections
end

Instance Method Details

#add_default_option(symbol, *opts, &block) ⇒ Object



31
32
33
# File 'lib/app-tester/options.rb', line 31

def add_default_option(symbol, *opts, &block)
  @default_options << {symbol: symbol, opts: opts, block: block }
end

#add_environment(environment) ⇒ AppTester::Options

Add a new environment to the environment list. This will be used when constructing AppTester::Parser object

Parameters:

  • environment (Hash)

    Symbol to String mapping

Returns:



26
27
28
29
# File 'lib/app-tester/options.rb', line 26

def add_environment environment
  @environments.merge! environment
  self
end