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.



26
27
28
29
30
31
32
# File 'lib/spellkit.rb', line 26

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.



24
25
26
# File 'lib/spellkit.rb', line 24

def dictionary
  @dictionary
end

#edit_distanceObject

Returns the value of attribute edit_distance.



24
25
26
# File 'lib/spellkit.rb', line 24

def edit_distance
  @edit_distance
end

#frequency_thresholdObject

Returns the value of attribute frequency_threshold.



24
25
26
# File 'lib/spellkit.rb', line 24

def frequency_threshold
  @frequency_threshold
end

#protected_pathObject

Returns the value of attribute protected_path.



24
25
26
# File 'lib/spellkit.rb', line 24

def protected_path
  @protected_path
end

#protected_patternsObject

Returns the value of attribute protected_patterns.



24
25
26
# File 'lib/spellkit.rb', line 24

def protected_patterns
  @protected_patterns
end

Instance Method Details

#to_hObject



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

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