Class: String

Inherits:
Object
  • Object
show all
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

Instance Method Details

#dasherizeObject

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

#dedasherizeObject

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