Class: Corrector::Parse
- Inherits:
-
String
- Object
- String
- Corrector::Parse
- Defined in:
- app/services/corrector/parse.rb
Overview
Converts a source to string using stored prefixes, words and phrases
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the source string having been parsed.
Instance Method Summary collapse
-
#initialize(value = "", scope:) ⇒ Parse
constructor
Parses given string, caches and returns the result of parsing.
Constructor Details
#initialize(value = "", scope:) ⇒ Parse
Parses given string, caches and returns the result of parsing.
Params:
value-
a string to be parsed
scope-
a scope (dictionary) for translations
Returns a converted string with a source method containing the source string and scope containing the scope for translation.
27 28 29 30 |
# File 'app/services/corrector/parse.rb', line 27 def initialize(value = "", scope:) @source, @scope = value.to_s, scope super phrase end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the source string having been parsed.
14 15 16 |
# File 'app/services/corrector/parse.rb', line 14 def source @source end |