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.
-
#concurrency ⇒ Object
Returns the value of attribute concurrency.
-
#log ⇒ Object
Returns the value of attribute log.
- #selenium_connect ⇒ Object
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.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/chemistrykit/configuration.rb', line 17 def initialize(hash) # set defaults @concurrency = 1 @selenium_connect = {} @log = OpenStruct.new @log.path = 'evidence' @log.results_file = 'results_junit.xml' @log.format = 'JUnit' # overide with argument populate_with_hash hash end |
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url.
10 11 12 |
# File 'lib/chemistrykit/configuration.rb', line 10 def base_url @base_url end |
#concurrency ⇒ Object
Returns the value of attribute concurrency.
10 11 12 |
# File 'lib/chemistrykit/configuration.rb', line 10 def concurrency @concurrency end |
#log ⇒ Object
Returns the value of attribute log.
13 14 15 |
# File 'lib/chemistrykit/configuration.rb', line 13 def log @log end |
#selenium_connect ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/chemistrykit/configuration.rb', line 37 def selenium_connect # return the default log unless the sc log is set if @selenium_connect[:log].nil? @selenium_connect[:log] = @log.path return @selenium_connect end @selenium_connect end |
Class Method Details
.initialize_with_yaml(file) ⇒ Object
46 47 48 |
# File 'lib/chemistrykit/configuration.rb', line 46 def self.initialize_with_yaml(file) self.new symbolize_keys YAML.load_file file end |