Class: ChemistryKit::Configuration
- Inherits:
-
Object
- Object
- ChemistryKit::Configuration
- Defined in:
- lib/chemistrykit/configuration.rb
Overview
Default configuration class
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#basic_auth ⇒ Object
Returns the value of attribute basic_auth.
-
#concurrency ⇒ Object
Returns the value of attribute concurrency.
-
#reporting ⇒ Object
readonly
Returns the value of attribute reporting.
-
#retries_on_failure ⇒ Object
Returns the value of attribute retries_on_failure.
-
#screenshot_on_fail ⇒ Object
Returns the value of attribute screenshot_on_fail.
- #selenium_connect ⇒ Object
-
#split_testing ⇒ Object
Returns the value of attribute split_testing.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(hash) ⇒ Configuration
Returns a new instance of Configuration.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/chemistrykit/configuration.rb', line 23 def initialize(hash) # set defaults @concurrency = 1 @retries_on_failure = 1 @selenium_connect = {} @screenshot_on_fail = false @reporting = ChemistryKit::Config::Reporting.new @basic_auth = nil @split_testing = nil # overide with argument populate_with_hash hash end |
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url.
14 15 16 |
# File 'lib/chemistrykit/configuration.rb', line 14 def base_url @base_url end |
#basic_auth ⇒ Object
Returns the value of attribute basic_auth.
19 20 21 |
# File 'lib/chemistrykit/configuration.rb', line 19 def basic_auth @basic_auth end |
#concurrency ⇒ Object
Returns the value of attribute concurrency.
14 15 16 |
# File 'lib/chemistrykit/configuration.rb', line 14 def concurrency @concurrency end |
#reporting ⇒ Object (readonly)
Returns the value of attribute reporting.
19 20 21 |
# File 'lib/chemistrykit/configuration.rb', line 19 def reporting @reporting end |
#retries_on_failure ⇒ Object
Returns the value of attribute retries_on_failure.
14 15 16 |
# File 'lib/chemistrykit/configuration.rb', line 14 def retries_on_failure @retries_on_failure end |
#screenshot_on_fail ⇒ Object
Returns the value of attribute screenshot_on_fail.
14 15 16 |
# File 'lib/chemistrykit/configuration.rb', line 14 def screenshot_on_fail @screenshot_on_fail end |
#selenium_connect ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/chemistrykit/configuration.rb', line 45 def selenium_connect # return the default log unless the sc log is set if @selenium_connect[:log].nil? @selenium_connect[:log] = @reporting.path return @selenium_connect end @selenium_connect end |
#split_testing ⇒ Object
Returns the value of attribute split_testing.
19 20 21 |
# File 'lib/chemistrykit/configuration.rb', line 19 def split_testing @split_testing end |
Class Method Details
.initialize_with_yaml(file) ⇒ Object
54 55 56 |
# File 'lib/chemistrykit/configuration.rb', line 54 def self.initialize_with_yaml(file) new symbolize_keys YAML.load_file file end |