Class: TestingBot::Config
- Inherits:
-
Object
- Object
- TestingBot::Config
- Defined in:
- lib/testingbot/config.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #add_options(options = {}) ⇒ Object
- #client_key ⇒ Object
- #client_secret ⇒ Object
- #desired_capabilities ⇒ Object
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
- #require_tunnel(host = "127.0.0.1", port = 4445) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
20 21 22 23 24 25 |
# File 'lib/testingbot/config.rb', line 20 def initialize( = {}) @options = @options = @options.merge(load_config_file) @options = @options.merge(load_config_environment) @options = @options.merge() end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
18 19 20 |
# File 'lib/testingbot/config.rb', line 18 def @options end |
Instance Method Details
#[](key) ⇒ Object
27 28 29 |
# File 'lib/testingbot/config.rb', line 27 def [](key) @options[key] end |
#[]=(key, value) ⇒ Object
35 36 37 |
# File 'lib/testingbot/config.rb', line 35 def []=(key, value) @options[key] = value end |
#add_options(options = {}) ⇒ Object
31 32 33 |
# File 'lib/testingbot/config.rb', line 31 def ( = {}) @options = @options.merge() end |
#client_key ⇒ Object
49 50 51 |
# File 'lib/testingbot/config.rb', line 49 def client_key @options[:client_key] end |
#client_secret ⇒ Object
53 54 55 |
# File 'lib/testingbot/config.rb', line 53 def client_secret @options[:client_secret] end |
#desired_capabilities ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/testingbot/config.rb', line 57 def desired_capabilities # check if instance of Selenium::WebDriver::Remote::Capabilities unless @options[:desired_capabilities].instance_of?(Hash) || @options[:desired_capabilities].instance_of?(Array) return symbolize_keys @options[:desired_capabilities].as_json end @options[:desired_capabilities] end |
#require_tunnel(host = "127.0.0.1", port = 4445) ⇒ Object
43 44 45 46 47 |
# File 'lib/testingbot/config.rb', line 43 def require_tunnel(host = "127.0.0.1", port = 4445) @options[:require_tunnel] = true @options[:host] = host @options[:port] = port end |