Class: TextHyphenRails::TextHyphenator

Inherits:
Hyphenator
  • Object
show all
Defined in:
lib/text_hyphen_rails/text_hyphenator.rb

Instance Method Summary collapse

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, options)
  super
  @text = text
end

Instance Method Details

#resultObject



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