Class: Simulacrum::Configuration
- Inherits:
-
Object
- Object
- Simulacrum::Configuration
- Defined in:
- lib/simulacrum/configuration.rb
Constant Summary collapse
- COMPONENT_DEFAULTS =
{ acceptable_delta: 1, window_size: [1024, 768], capture_delay: nil, capture_selector: :html, }
Instance Attribute Summary collapse
-
#acceptable_delta ⇒ Object
readonly
Returns the value of attribute acceptable_delta.
-
#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.
-
#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
- #configure(config) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 |
# File 'lib/simulacrum/configuration.rb', line 17 def initialize @config = OpenStruct.new(defaults: OpenStruct.new(COMPONENT_DEFAULTS)) end |
Instance Attribute Details
#acceptable_delta ⇒ Object (readonly)
Returns the value of attribute acceptable_delta.
13 14 15 |
# File 'lib/simulacrum/configuration.rb', line 13 def acceptable_delta @acceptable_delta end |
#candidate_filename ⇒ Object (readonly)
Returns the value of attribute candidate_filename.
13 14 15 |
# File 'lib/simulacrum/configuration.rb', line 13 def candidate_filename @candidate_filename end |
#capture_delay ⇒ Object (readonly)
Returns the value of attribute capture_delay.
13 14 15 |
# File 'lib/simulacrum/configuration.rb', line 13 def capture_delay @capture_delay end |
#capture_selector ⇒ Object (readonly)
Returns the value of attribute capture_selector.
13 14 15 |
# File 'lib/simulacrum/configuration.rb', line 13 def capture_selector @capture_selector end |
#default_browser ⇒ Object (readonly)
Returns the value of attribute default_browser.
13 14 15 |
# File 'lib/simulacrum/configuration.rb', line 13 def default_browser @default_browser end |
#diff_filename ⇒ Object (readonly)
Returns the value of attribute diff_filename.
13 14 15 |
# File 'lib/simulacrum/configuration.rb', line 13 def diff_filename @diff_filename end |
#reference_filename ⇒ Object (readonly)
Returns the value of attribute reference_filename.
13 14 15 |
# File 'lib/simulacrum/configuration.rb', line 13 def reference_filename @reference_filename end |
#references_path ⇒ Object (readonly)
Returns the value of attribute references_path.
13 14 15 |
# File 'lib/simulacrum/configuration.rb', line 13 def references_path @references_path end |
#window_size ⇒ Object (readonly)
Returns the value of attribute window_size.
13 14 15 |
# File 'lib/simulacrum/configuration.rb', line 13 def window_size @window_size end |
Instance Method Details
#configure(config) ⇒ Object
21 22 23 |
# File 'lib/simulacrum/configuration.rb', line 21 def configure(config) @config = OpenStruct.new(@config.to_h.merge!(config)) end |