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, ::Helpers::Array::Join.new) config..helper(:join_post, ::Helpers::Array::JoinPost.new) config..helper(:join_pre, ::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, ::Helpers::Case::BackSlash.new, aliases: i[backward_slash slash_backward]) config..helper(:camel, ::Helpers::Case::Camel.new, aliases: i[camel_upper camelUpper camelU pascalcase]) config..helper(:constant, ::Helpers::Case::Constant.new, aliases: i[constantize]) config..helper(:dash, ::Helpers::Case::Dash.new, aliases: i[dasherize dashify dashcase hyphenate]) config..helper(:dot, ::Helpers::Case::Dot.new, aliases: i[dotirize dotify dotcase hyphenate]) config..helper(:double_colon, ::Helpers::Case::DoubleColon.new) config..helper(:human, ::Helpers::Case::Human.new, aliases: i[humanize sentence]) config..helper(:lamel, ::Helpers::Case::Lamel.new, aliases: i[camel_lower camelLower camelL]) config..helper(:lower, ::Helpers::Case::Lower.new, aliases: i[lowercase downcase]) config..helper(:slash, ::Helpers::Case::Slash.new, aliases: i[forward_slash slash_forward]) config..helper(:snake, ::Helpers::Case::Snake.new) config..helper(:title, ::Helpers::Case::Title.new, aliases: i[titleize]) config..helper(:upper, ::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, ::Helpers::Comparison::And.new) config..helper(:default, ::Helpers::Comparison::Default.new) config..helper(:eq, ::Helpers::Comparison::Eq.new) config..helper(:gt, ::Helpers::Comparison::Gt.new) config..helper(:gte, ::Helpers::Comparison::Gte.new) config..helper(:lt, ::Helpers::Comparison::Lt.new) config..helper(:lte, ::Helpers::Comparison::Lte.new) config..helper(:ne, ::Helpers::Comparison::Ne.new) config..helper(:or, ::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, ::Helpers::Inflection::Ordinal.new) config..helper(:ordinalize, ::Helpers::Inflection::Ordinalize.new) config..helper(:pluralize, ::Helpers::Inflection::Pluralize.new) config..helper(:pluralize_number, ::Helpers::Inflection::PluralizeNumber.new) config..helper(:pluralize_number_word, ::Helpers::Inflection::PluralizeNumberWord.new) config..helper(:singularize, ::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, ::Helpers::Misc::FormatJson.new) config..helper(:safe, ::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, ::Helpers::Str::Padl.new) config..helper(:padr, ::Helpers::Str::Padr.new) end end |