Class: Kangaru::Inflectors::ConstantInflector
- Inherits:
-
ClassInflector
- Object
- Inflector
- ClassInflector
- Kangaru::Inflectors::ConstantInflector
- Defined in:
- lib/kangaru/inflectors/constant_inflector.rb
Constant Summary collapse
- LAST_WORD =
/(::)?(?!.*::)(.*)$/
Constants inherited from Inflector
Inflector::DEFAULT_GROUP_JOINER
Instance Attribute Summary
Attributes inherited from Inflector
Instance Method Summary collapse
Methods inherited from Inflector
Methods included from InflectorMacros
#filter_input_with, #inherited, #join_groups_with, #join_tokens_with, #post_process_with, #transform_tokens_with
Constructor Details
This class inherits a constructor from Kangaru::Inflectors::Inflector
Instance Method Details
#inflect ⇒ Object
6 7 8 9 10 |
# File 'lib/kangaru/inflectors/constant_inflector.rb', line 6 def inflect super.gsub(LAST_WORD) do |last_word| ScreamingSnakecaseInflector.inflect(last_word) end end |