Module: BlogHelper

Defined in:
lib/nexmo_developer/app/helpers/blog_helper.rb

Instance Method Summary collapse

Instance Method Details

#reading_time_without_code_tags(content) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/nexmo_developer/app/helpers/blog_helper.rb', line 2

def reading_time_without_code_tags(content)
  regexp = Regexp.new(%r{<pre class=.*main-code(.*?)</code></pre>}m)

  "#{content.gsub(regexp, '').reading_time format: :approx} read"
rescue StandardError
  ''
end