Class: Handlebars::Helpers::StringFormatting::BackSlash

Inherits:
BaseHelper
  • Object
show all
Defined in:
lib/handlebars/helpers/string_formatting/back_slash.rb

Overview

convert to back slash notation

Instance Method Summary collapse

Methods inherited from BaseHelper

#handlebars_helper, #parse_json, #struct_to_hash, #tokenizer, #wrapper

Instance Method Details

#parse(value) ⇒ String

Parse will convert to back slash notation

Examples:


puts BackSlash.new.parse('the Quick brown Fox 99')

the\quick\brown\fox99

Returns:

  • (String)

    value converted to back_slash case



27
28
29
# File 'lib/handlebars/helpers/string_formatting/back_slash.rb', line 27

def parse(value)
  tokenizer.parse(value, preserve_case: true, separator: '\\')
end