Class: DiffMatchPatchES::Options
- Inherits:
-
Object
- Object
- DiffMatchPatchES::Options
- Defined in:
- lib/diff_match_patch_es/options.rb,
sig/diff_match_patch_es/options.rbs
Constant Summary collapse
- ATTRIBUTES =
%i[ diff_timeout diff_edit_cost match_threshold match_distance patch_delete_threshold patch_margin match_max_bits ].freeze
Instance Attribute Summary collapse
-
#diff_edit_cost ⇒ Integer
Returns the value of attribute diff_edit_cost.
-
#diff_timeout ⇒ Numeric
Returns the value of attribute diff_timeout.
-
#match_distance ⇒ Integer
Returns the value of attribute match_distance.
-
#match_max_bits ⇒ Integer
Returns the value of attribute match_max_bits.
-
#match_threshold ⇒ Numeric
Returns the value of attribute match_threshold.
-
#patch_delete_threshold ⇒ Numeric
Returns the value of attribute patch_delete_threshold.
-
#patch_margin ⇒ Integer
Returns the value of attribute patch_margin.
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#initialize(diff_timeout: 1.0, diff_edit_cost: 4, match_threshold: 0.5, match_distance: 1000, patch_delete_threshold: 0.5, patch_margin: 4, match_max_bits: 32) ⇒ Options
constructor
A new instance of Options.
- #to_h ⇒ Hash[Symbol, Numeric]
Constructor Details
#initialize(diff_timeout: 1.0, diff_edit_cost: 4, match_threshold: 0.5, match_distance: 1000, patch_delete_threshold: 0.5, patch_margin: 4, match_max_bits: 32) ⇒ Options
Returns a new instance of Options.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/diff_match_patch_es/options.rb', line 17 def initialize( diff_timeout: 1.0, diff_edit_cost: 4, match_threshold: 0.5, match_distance: 1000, patch_delete_threshold: 0.5, patch_margin: 4, match_max_bits: 32 ) @diff_timeout = diff_timeout @diff_edit_cost = diff_edit_cost @match_threshold = match_threshold @match_distance = match_distance @patch_delete_threshold = patch_delete_threshold @patch_margin = patch_margin @match_max_bits = match_max_bits end |
Instance Attribute Details
#diff_edit_cost ⇒ Integer
Returns the value of attribute diff_edit_cost.
7 8 9 |
# File 'sig/diff_match_patch_es/options.rbs', line 7 def diff_edit_cost @diff_edit_cost end |
#diff_timeout ⇒ Numeric
Returns the value of attribute diff_timeout.
5 6 7 |
# File 'sig/diff_match_patch_es/options.rbs', line 5 def diff_timeout @diff_timeout end |
#match_distance ⇒ Integer
Returns the value of attribute match_distance.
11 12 13 |
# File 'sig/diff_match_patch_es/options.rbs', line 11 def match_distance @match_distance end |
#match_max_bits ⇒ Integer
Returns the value of attribute match_max_bits.
17 18 19 |
# File 'sig/diff_match_patch_es/options.rbs', line 17 def match_max_bits @match_max_bits end |
#match_threshold ⇒ Numeric
Returns the value of attribute match_threshold.
9 10 11 |
# File 'sig/diff_match_patch_es/options.rbs', line 9 def match_threshold @match_threshold end |
#patch_delete_threshold ⇒ Numeric
Returns the value of attribute patch_delete_threshold.
13 14 15 |
# File 'sig/diff_match_patch_es/options.rbs', line 13 def patch_delete_threshold @patch_delete_threshold end |
#patch_margin ⇒ Integer
Returns the value of attribute patch_margin.
15 16 17 |
# File 'sig/diff_match_patch_es/options.rbs', line 15 def patch_margin @patch_margin end |
Instance Method Details
#==(other) ⇒ Boolean
39 40 41 |
# File 'lib/diff_match_patch_es/options.rb', line 39 def ==(other) other.is_a?(Options) && to_h == other.to_h end |
#to_h ⇒ Hash[Symbol, Numeric]
35 36 37 |
# File 'lib/diff_match_patch_es/options.rb', line 35 def to_h ATTRIBUTES.to_h { |name| [name, public_send(name)] } end |