No commit activity in last 3 years
No release in over 3 years
Extraction of the key_transform abilities of ActiveModelSerializers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

case_transform

Extraction of the key_transform abilities of ActiveModelSerializers

Gem Version Build Status Code Climate Test Coverage Dependency Status

Performance

$ ruby benchmark.rb

         Rust: camel:   238774.9 i/s
         Ruby: camel:    13107.3 i/s - 18.22x  slower

   Rust: camel_lower:   230641.5 i/s
   Ruby: camel_lower:     8244.1 i/s - 27.98x  slower

          Rust: dash:   243197.8 i/s
          Ruby: dash:    20350.9 i/s - 11.95x  slower

     Ruby: unaltered:  6030498.8 i/s
     Rust: unaltered:  1960989.6 i/s - 3.08x  slower

    Rust: underscore:   291052.3 i/s
    Ruby: underscore:   169458.2 i/s - 1.72x  slower

Install

gem 'case_transform-rust-extensions', require: 'case_transform'

or

gem install case_transform-rust-extensions

Installation Dependencies

  • curl
  • git

Usage

require 'case_transform'

CaseTransform.camel_lower(value)

value can be any of Array, Hash, Symbol, or String. Any other object type will just be returned.

Transforms

  Description
camel PascalCase
camel_lower camelCase
dash dash-case
underscore under_score
unaltered pass through