Class: Togglate::BlockWrapper
- Inherits:
-
Object
- Object
- Togglate::BlockWrapper
- Defined in:
- lib/togglate/block_wrapper.rb
Instance Method Summary collapse
-
#initialize(text, wrapper: %w(<!--original -->), pretext: "[translation here]", wrap_exceptions: [], **opts) ⇒ BlockWrapper
constructor
A new instance of BlockWrapper.
- #run ⇒ Object
Constructor Details
#initialize(text, wrapper: %w(<!--original -->), pretext: "[translation here]", wrap_exceptions: [], **opts) ⇒ BlockWrapper
Returns a new instance of BlockWrapper.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/togglate/block_wrapper.rb', line 4 def initialize(text, wrapper:%w(<!--original -->), pretext:"[translation here]", wrap_exceptions:[], **opts) @text = text @wrapper = wrapper @pretext = pretext @wrap_exceptions = wrap_exceptions @translate = set_translate_opt(opts[:translate]) @timeout = opts.fetch(:timeout, 5) @email = opts[:email] @indent_re = /^\s{4,}\S/ end |
Instance Method Details
#run ⇒ Object
19 20 21 |
# File 'lib/togglate/block_wrapper.rb', line 19 def run wrap_chunks build_chunks end |