Class: Handlebars::Helpers::StringFormatting::Slash

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

Overview

slash case the characters in the given ‘string’.

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 slash case the characters in the given ‘string’.

Examples:


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

the/Quick/brown/Fox99

Returns:

  • value converted to slash notation



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

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