Class: Handlebars::Helpers::CodeRuby::Demodulize
- Inherits:
-
BaseHelper
- Object
- BaseHelper
- Handlebars::Helpers::CodeRuby::Demodulize
- Defined in:
- lib/handlebars/helpers/code_ruby/demodulize.rb
Overview
Demodulize: Removes the module part from the expression in the string.
Instance Method Summary collapse
- #handlebars_helper ⇒ Object
-
#parse(value) ⇒ String
Parse will demodulize, aka remove the module part from the expression in the string.
Methods inherited from BaseHelper
#parse_json, #struct_to_hash, #tokenizer, #wrapper
Instance Method Details
#handlebars_helper ⇒ Object
52 53 54 |
# File 'lib/handlebars/helpers/code_ruby/demodulize.rb', line 52 def proc { |_context, value| wrapper(parse(value)) } end |
#parse(value) ⇒ String
Parse will demodulize, aka remove the module part from the expression in the string.
46 47 48 49 50 |
# File 'lib/handlebars/helpers/code_ruby/demodulize.rb', line 46 def parse(value) return '' if value.nil? value.demodulize end |