Class: Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/acceleration/monkeypatches.rb

Overview

Monkeypatches on Symbol 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.



36
37
38
# File 'lib/acceleration/monkeypatches.rb', line 36

def dasherize
  to_s.downcase.tr('_', '-').to_sym
end

#dedasherizeObject

Convenience function for converting Velocity API method names to Ruby method or symbol names.



43
44
45
# File 'lib/acceleration/monkeypatches.rb', line 43

def dedasherize
  to_s.tr('-', '_').to_sym
end