Class: Simulacrum::Configuration

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_deltaObject (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_filenameObject (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_delayObject (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_selectorObject (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_browserObject (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_filenameObject (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_filenameObject (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_pathObject (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_sizeObject (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