Class: Nexmo::Markdown::DynamicContentFilter

Inherits:
Banzai::Filter
  • Object
show all
Defined in:
lib/nexmo_markdown_renderer/filters/dynamic_content_filter.rb

Instance Method Summary collapse

Instance Method Details

#call(input) ⇒ Object



4
5
6
7
8
9
# File 'lib/nexmo_markdown_renderer/filters/dynamic_content_filter.rb', line 4

def call(input)
  input.gsub(/(\s|^)\[\~(.+?)\~\](\s|$)/) do
    content = environment_value($2) || config_value($2) || "VALUE NOT SET: #{$2}"
    "#{$1}#{content}#{$3}"
  end
end