Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/acceleration/monkeypatches.rb
Overview
Monkeypatches on String to provide convenience methods
Warning: these could go away at any time, so do not rely on their continued existence. They should only be used internally within the Acceleration gem.
Instance Method Summary collapse
-
#dasherize ⇒ Object
Convenience function for converting Ruby method names to Velocity API method names by replacing underscores with dashes.
-
#dedasherize ⇒ Object
Convenience function for converting Velocity API method names to Ruby method or symbol names.
Instance Method Details
#dasherize ⇒ Object
Convenience function for converting Ruby method names to Velocity API method names by replacing underscores with dashes.
14 15 16 |
# File 'lib/acceleration/monkeypatches.rb', line 14 def dasherize downcase.tr('_', '-') end |
#dedasherize ⇒ Object
Convenience function for converting Velocity API method names to Ruby method or symbol names.
21 22 23 |
# File 'lib/acceleration/monkeypatches.rb', line 21 def dedasherize tr('-', '_') end |