Class: Canon::Comparison::ResolvedMatchOptions
- Inherits:
-
Object
- Object
- Canon::Comparison::ResolvedMatchOptions
- Defined in:
- lib/canon/comparison/match_options.rb
Overview
Wrapper class for resolved match options Provides convenient methods for accessing behaviors by dimension
Instance Attribute Summary collapse
-
#compare_profile ⇒ Object
readonly
Returns the value of attribute compare_profile.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#behavior_for(dimension) ⇒ Symbol
Get the behavior for a specific dimension.
-
#initialize(options, format:, compare_profile: nil) ⇒ ResolvedMatchOptions
constructor
A new instance of ResolvedMatchOptions.
-
#preprocessing ⇒ Symbol
Get the preprocessing option.
-
#semantic_diff? ⇒ Boolean
Check if semantic diff is enabled.
- #to_h ⇒ Object
Constructor Details
#initialize(options, format:, compare_profile: nil) ⇒ ResolvedMatchOptions
Returns a new instance of ResolvedMatchOptions.
25 26 27 28 29 |
# File 'lib/canon/comparison/match_options.rb', line 25 def initialize(, format:, compare_profile: nil) @options = @format = format @compare_profile = compare_profile end |
Instance Attribute Details
#compare_profile ⇒ Object (readonly)
Returns the value of attribute compare_profile.
23 24 25 |
# File 'lib/canon/comparison/match_options.rb', line 23 def compare_profile @compare_profile end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
23 24 25 |
# File 'lib/canon/comparison/match_options.rb', line 23 def format @format end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
23 24 25 |
# File 'lib/canon/comparison/match_options.rb', line 23 def @options end |
Instance Method Details
#behavior_for(dimension) ⇒ Symbol
Get the behavior for a specific dimension
34 35 36 |
# File 'lib/canon/comparison/match_options.rb', line 34 def behavior_for(dimension) @options[dimension] end |
#preprocessing ⇒ Symbol
Get the preprocessing option
40 41 42 |
# File 'lib/canon/comparison/match_options.rb', line 40 def preprocessing @options[:preprocessing] end |
#semantic_diff? ⇒ Boolean
Check if semantic diff is enabled
46 47 48 |
# File 'lib/canon/comparison/match_options.rb', line 46 def semantic_diff? @options[:semantic_diff] == true end |
#to_h ⇒ Object
50 51 52 |
# File 'lib/canon/comparison/match_options.rb', line 50 def to_h @options.dup end |