Class: Handlebars::Helpers::CodeRuby::Tableize
- Inherits:
-
BaseHelper
- Object
- BaseHelper
- Handlebars::Helpers::CodeRuby::Tableize
- Defined in:
- lib/handlebars/helpers/code_ruby/tableize.rb
Overview
Tableize: Creates the name of a table like Rails does when converting models to table names
Instance Method Summary collapse
- #handlebars_helper ⇒ Object
-
#parse(value) ⇒ String
Parse will creates the name of a table like Rails does when converting models to table names.
Methods inherited from BaseHelper
#parse_json, #struct_to_hash, #tokenizer, #wrapper
Instance Method Details
#handlebars_helper ⇒ Object
29 30 31 |
# File 'lib/handlebars/helpers/code_ruby/tableize.rb', line 29 def proc { |_context, value| wrapper(parse(value)) } end |
#parse(value) ⇒ String
Parse will creates the name of a table like Rails does when converting models to table names
24 25 26 27 |
# File 'lib/handlebars/helpers/code_ruby/tableize.rb', line 24 def parse(value) # tokenizer.parse(value, separator: '_', forced_separator: true).classify tokenizer.parse(value).tableize end |