module VacuumCleaner
@see VacuumCleaner::Normalizations
@see VacuumCleaner::Normalizer
Constants
- VERSION
VacuumCleaner
version- WITHOUT_NORMALIZATION_SUFFIX
@private Suffix added to existing setter methods
Public Class Methods
@private Okay, because this library currently does not depend on ActiveSupport
or anything similar an “independent” camelizing process is required.
How it works: If value.to_s
responds to :camelize
, then call it else, use implementation taken from github.com/rails/rails/blob/master/activesupport/lib/active_support/inflector/methods.rb#L25
# File lib/vacuum_cleaner/normalizations.rb, line 98 def camelize_value(value) value = value.to_s value.respond_to?(:camelize) ? value.camelize : value.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase } end
Private Instance Methods
@private Okay, because this library currently does not depend on ActiveSupport
or anything similar an “independent” camelizing process is required.
How it works: If value.to_s
responds to :camelize
, then call it else, use implementation taken from github.com/rails/rails/blob/master/activesupport/lib/active_support/inflector/methods.rb#L25
# File lib/vacuum_cleaner/normalizations.rb, line 98 def camelize_value(value) value = value.to_s value.respond_to?(:camelize) ? value.camelize : value.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase } end