Module: Kangaru::Inflectors::InflectorMacros
- Included in:
- Inflector
- Defined in:
- lib/kangaru/inflectors/inflector_macros.rb
Instance Method Summary collapse
- #filter_input_with(pattern) ⇒ Object
- #inherited(child_class) ⇒ Object
- #join_groups_with(joiner) ⇒ Object
- #join_tokens_with(joiner) ⇒ Object
- #post_process_with(symbol = nil, &block) ⇒ Object
- #transform_tokens_with(symbol = nil, &block) ⇒ Object
Instance Method Details
#filter_input_with(pattern) ⇒ Object
12 13 14 |
# File 'lib/kangaru/inflectors/inflector_macros.rb', line 12 def filter_input_with(pattern) @input_filter = pattern end |
#inherited(child_class) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/kangaru/inflectors/inflector_macros.rb', line 4 def inherited(child_class) instance_variables.each do |rule| value = instance_variable_get(rule) child_class.instance_variable_set(rule, value) end end |
#join_groups_with(joiner) ⇒ Object
24 25 26 |
# File 'lib/kangaru/inflectors/inflector_macros.rb', line 24 def join_groups_with(joiner) @group_joiner = joiner end |
#join_tokens_with(joiner) ⇒ Object
20 21 22 |
# File 'lib/kangaru/inflectors/inflector_macros.rb', line 20 def join_tokens_with(joiner) @token_joiner = joiner end |
#post_process_with(symbol = nil, &block) ⇒ Object
28 29 30 |
# File 'lib/kangaru/inflectors/inflector_macros.rb', line 28 def post_process_with(symbol = nil, &block) @post_processor = symbol || block end |
#transform_tokens_with(symbol = nil, &block) ⇒ Object
16 17 18 |
# File 'lib/kangaru/inflectors/inflector_macros.rb', line 16 def transform_tokens_with(symbol = nil, &block) @token_transformer = symbol || block end |