Class: SpellKit::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/spellkit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



33
34
35
36
37
38
39
# File 'lib/spellkit.rb', line 33

def initialize
  @dictionary = DEFAULT_DICTIONARY_URL
  @protected_path = nil
  @protected_patterns = []
  @edit_distance = 1
  @frequency_threshold = 10.0
end

Instance Attribute Details

#dictionaryObject

Returns the value of attribute dictionary.



31
32
33
# File 'lib/spellkit.rb', line 31

def dictionary
  @dictionary
end

#edit_distanceObject

Returns the value of attribute edit_distance.



31
32
33
# File 'lib/spellkit.rb', line 31

def edit_distance
  @edit_distance
end

#frequency_thresholdObject

Returns the value of attribute frequency_threshold.



31
32
33
# File 'lib/spellkit.rb', line 31

def frequency_threshold
  @frequency_threshold
end

#protected_pathObject

Returns the value of attribute protected_path.



31
32
33
# File 'lib/spellkit.rb', line 31

def protected_path
  @protected_path
end

#protected_patternsObject

Returns the value of attribute protected_patterns.



31
32
33
# File 'lib/spellkit.rb', line 31

def protected_patterns
  @protected_patterns
end

Instance Method Details

#to_hObject



41
42
43
44
45
46
47
48
49
# File 'lib/spellkit.rb', line 41

def to_h
  {
    dictionary: @dictionary,
    protected_path: @protected_path,
    protected_patterns: @protected_patterns,
    edit_distance: @edit_distance,
    frequency_threshold: @frequency_threshold
  }
end