Class: Handlebarsjs::HandlebarsConfigurationDefaults
- Inherits:
-
Object
- Object
- Handlebarsjs::HandlebarsConfigurationDefaults
- Defined in:
- lib/handlebarsjs/handlebars_configuration_defaults.rb
Overview
Pre-configure default helpers for each category
Instance Method Summary collapse
- #add_all_defaults ⇒ Object
- #add_array_defaults ⇒ Object
- #add_case_defaults ⇒ Object
- #add_comparison_defaults ⇒ Object
- #add_inflection_defaults ⇒ Object
- #add_misc_defaults ⇒ Object
- #add_str_defaults ⇒ Object
Instance Method Details
#add_all_defaults ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/handlebarsjs/handlebars_configuration_defaults.rb', line 6 def add_all_defaults add_array_defaults add_case_defaults add_comparison_defaults add_inflection_defaults add_misc_defaults add_str_defaults end |
#add_array_defaults ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/handlebarsjs/handlebars_configuration_defaults.rb', line 15 def add_array_defaults KConfig.configure do |config| config..helper(:join, Handlebarsjs::Helpers::Array::Join.new) config..helper(:join_post, Handlebarsjs::Helpers::Array::JoinPost.new) config..helper(:join_pre, Handlebarsjs::Helpers::Array::JoinPre.new) end end |
#add_case_defaults ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/handlebarsjs/handlebars_configuration_defaults.rb', line 23 def add_case_defaults KConfig.configure do |config| config..helper(:back_slash, Handlebarsjs::Helpers::Case::BackSlash.new, aliases: %i[backward_slash slash_backward]) config..helper(:camel, Handlebarsjs::Helpers::Case::Camel.new, aliases: %i[camel_upper camelUpper camelU pascalcase]) config..helper(:constant, Handlebarsjs::Helpers::Case::Constant.new, aliases: %i[constantize]) config..helper(:dash, Handlebarsjs::Helpers::Case::Dash.new, aliases: %i[dasherize dashify dashcase hyphenate]) config..helper(:dot, Handlebarsjs::Helpers::Case::Dot.new, aliases: %i[dotirize dotify dotcase hyphenate]) config..helper(:double_colon, Handlebarsjs::Helpers::Case::DoubleColon.new) config..helper(:human, Handlebarsjs::Helpers::Case::Human.new, aliases: %i[humanize sentence]) config..helper(:lamel, Handlebarsjs::Helpers::Case::Lamel.new, aliases: %i[camel_lower camelLower camelL]) config..helper(:lower, Handlebarsjs::Helpers::Case::Lower.new, aliases: %i[lowercase downcase]) config..helper(:slash, Handlebarsjs::Helpers::Case::Slash.new, aliases: %i[forward_slash slash_forward]) config..helper(:snake, Handlebarsjs::Helpers::Case::Snake.new) config..helper(:title, Handlebarsjs::Helpers::Case::Title.new, aliases: %i[titleize]) config..helper(:upper, Handlebarsjs::Helpers::Case::Upper.new, aliases: %i[upcase uppercase]) end end |
#add_comparison_defaults ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/handlebarsjs/handlebars_configuration_defaults.rb', line 41 def add_comparison_defaults KConfig.configure do |config| config..helper(:and, Handlebarsjs::Helpers::Comparison::And.new) config..helper(:default, Handlebarsjs::Helpers::Comparison::Default.new) config..helper(:eq, Handlebarsjs::Helpers::Comparison::Eq.new) config..helper(:gt, Handlebarsjs::Helpers::Comparison::Gt.new) config..helper(:gte, Handlebarsjs::Helpers::Comparison::Gte.new) config..helper(:lt, Handlebarsjs::Helpers::Comparison::Lt.new) config..helper(:lte, Handlebarsjs::Helpers::Comparison::Lte.new) config..helper(:ne, Handlebarsjs::Helpers::Comparison::Ne.new) config..helper(:or, Handlebarsjs::Helpers::Comparison::Or.new) end end |
#add_inflection_defaults ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/handlebarsjs/handlebars_configuration_defaults.rb', line 55 def add_inflection_defaults KConfig.configure do |config| config..helper(:ordinal, Handlebarsjs::Helpers::Inflection::Ordinal.new) config..helper(:ordinalize, Handlebarsjs::Helpers::Inflection::Ordinalize.new) config..helper(:pluralize, Handlebarsjs::Helpers::Inflection::Pluralize.new) config..helper(:pluralize_number, Handlebarsjs::Helpers::Inflection::PluralizeNumber.new) config..helper(:pluralize_number_word, Handlebarsjs::Helpers::Inflection::PluralizeNumberWord.new) config..helper(:singularize, Handlebarsjs::Helpers::Inflection::Singularize.new) end end |
#add_misc_defaults ⇒ Object
66 67 68 69 70 71 |
# File 'lib/handlebarsjs/handlebars_configuration_defaults.rb', line 66 def add_misc_defaults KConfig.configure do |config| config..helper(:format_json, Handlebarsjs::Helpers::Misc::FormatJson.new) config..helper(:safe, Handlebarsjs::Helpers::Misc::Safe.new) end end |
#add_str_defaults ⇒ Object
73 74 75 76 77 78 |
# File 'lib/handlebarsjs/handlebars_configuration_defaults.rb', line 73 def add_str_defaults KConfig.configure do |config| config..helper(:padl, Handlebarsjs::Helpers::Str::Padl.new) config..helper(:padr, Handlebarsjs::Helpers::Str::Padr.new) end end |