Method: Howzit::StringUtils#render_numeric_placeholders
- Defined in:
- lib/howzit/stringutils.rb
#render_numeric_placeholders ⇒ Object
262 263 264 265 266 267 268 |
# File 'lib/howzit/stringutils.rb', line 262 def render_numeric_placeholders gsub!(/\$\{?(\d+)\}?/) do arg, default = Regexp.last_match(1).split(/:/) idx = arg.to_i - 1 Howzit.arguments.length > idx ? Howzit.arguments[idx] : default || Regexp.last_match(0) end end |