Sha256: 90fe4e13cb2aea7dcb2e7f1d79f3209069c3157a3d639b227ebaf934b833cc47
Contents?: true
Size: 611 Bytes
Versions: 2
Compression:
Stored size: 611 Bytes
Contents
module Sparrow module Strategies module KeyTransformation ## # Strategy class for snake_casing keys class UnderscoreKey ## # Create a new UnderscoreKey Strategy # Does nothing except returning a plain instance. def initialize(*_args) # no initialization needed end ## # Transforms the given key to snake_case format # @param [String] key the key to be transformed # @return [String] the snake_cased key def transform_key(key) key.to_s.underscore end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cp-sparrow-0.0.16 | lib/sparrow/strategies/key_transformation/underscore_key.rb |
cp-sparrow-0.0.15 | lib/sparrow/strategies/key_transformation/underscore_key.rb |