Class: Simulacrum::Configuration
- Inherits:
-
Object
- Object
- Simulacrum::Configuration
- Defined in:
- lib/simulacrum/configuration.rb
Overview
Configuration Class for managing config of the suite
Constant Summary collapse
- COMPONENT_DEFAULTS =
{ delta_threshold: 1, window_size: [1024, 768], capture_delay: nil, capture_selector: :html }
Instance Attribute Summary collapse
-
#candidate_filename ⇒ Object
readonly
Returns the value of attribute candidate_filename.
-
#capture_delay ⇒ Object
readonly
Returns the value of attribute capture_delay.
-
#capture_selector ⇒ Object
readonly
Returns the value of attribute capture_selector.
-
#default_browser ⇒ Object
readonly
Returns the value of attribute default_browser.
-
#delta_threshold ⇒ Object
readonly
Returns the value of attribute delta_threshold.
-
#diff_filename ⇒ Object
readonly
Returns the value of attribute diff_filename.
-
#reference_filename ⇒ Object
readonly
Returns the value of attribute reference_filename.
-
#references_path ⇒ Object
readonly
Returns the value of attribute references_path.
-
#window_size ⇒ Object
readonly
Returns the value of attribute window_size.
Instance Method Summary collapse
- #build_name ⇒ Object
- #configure(config) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #project_name ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 |
# File 'lib/simulacrum/configuration.rb', line 18 def initialize @config = OpenStruct.new(component: OpenStruct.new(COMPONENT_DEFAULTS)) end |
Instance Attribute Details
#candidate_filename ⇒ Object (readonly)
Returns the value of attribute candidate_filename.
14 15 16 |
# File 'lib/simulacrum/configuration.rb', line 14 def candidate_filename @candidate_filename end |
#capture_delay ⇒ Object (readonly)
Returns the value of attribute capture_delay.
14 15 16 |
# File 'lib/simulacrum/configuration.rb', line 14 def capture_delay @capture_delay end |
#capture_selector ⇒ Object (readonly)
Returns the value of attribute capture_selector.
14 15 16 |
# File 'lib/simulacrum/configuration.rb', line 14 def capture_selector @capture_selector end |
#default_browser ⇒ Object (readonly)
Returns the value of attribute default_browser.
14 15 16 |
# File 'lib/simulacrum/configuration.rb', line 14 def default_browser @default_browser end |
#delta_threshold ⇒ Object (readonly)
Returns the value of attribute delta_threshold.
14 15 16 |
# File 'lib/simulacrum/configuration.rb', line 14 def delta_threshold @delta_threshold end |
#diff_filename ⇒ Object (readonly)
Returns the value of attribute diff_filename.
14 15 16 |
# File 'lib/simulacrum/configuration.rb', line 14 def diff_filename @diff_filename end |
#reference_filename ⇒ Object (readonly)
Returns the value of attribute reference_filename.
14 15 16 |
# File 'lib/simulacrum/configuration.rb', line 14 def reference_filename @reference_filename end |
#references_path ⇒ Object (readonly)
Returns the value of attribute references_path.
14 15 16 |
# File 'lib/simulacrum/configuration.rb', line 14 def references_path @references_path end |
#window_size ⇒ Object (readonly)
Returns the value of attribute window_size.
14 15 16 |
# File 'lib/simulacrum/configuration.rb', line 14 def window_size @window_size end |
Instance Method Details
#build_name ⇒ Object
56 57 58 |
# File 'lib/simulacrum/configuration.rb', line 56 def build_name @config.build_name || '' end |
#configure(config) ⇒ Object
22 23 24 |
# File 'lib/simulacrum/configuration.rb', line 22 def configure(config) @config = OpenStruct.new(@config.to_h.merge!(config)) end |
#project_name ⇒ Object
60 61 62 |
# File 'lib/simulacrum/configuration.rb', line 60 def project_name @config.project_name || 'Simulacrum' end |