Class: TextHyphenRails::TextHyphenator
- Inherits:
-
Hyphenator
- Object
- Hyphenator
- TextHyphenRails::TextHyphenator
- Defined in:
- lib/text_hyphen_rails/text_hyphenator.rb
Instance Method Summary collapse
-
#initialize(text, lang, options) ⇒ TextHyphenator
constructor
A new instance of TextHyphenator.
- #result ⇒ Object
Constructor Details
#initialize(text, lang, options) ⇒ TextHyphenator
Returns a new instance of TextHyphenator.
5 6 7 8 |
# File 'lib/text_hyphen_rails/text_hyphenator.rb', line 5 def initialize(text, lang, ) super @text = text end |
Instance Method Details
#result ⇒ Object
10 11 12 13 14 |
# File 'lib/text_hyphen_rails/text_hyphenator.rb', line 10 def result @text.gsub regex do |tok| hyphenator.visualize(tok, @opts[:hyphen]) end end |