Class Wrest::Components::Mutators::CamelToSnakeCase

  1. lib/wrest/components/mutators/camel_to_snake_case.rb
Parent: Mutators::Base

Converts the key to snake case

Example:

Mutators::CamelToSnakeCase.new.mutate(['Spirit-Sword', 'true'])  # => ['spirit_sword', 'true']**

Methods

public instance

  1. do_mutate

Public instance methods

do_mutate (tuple)
[show source]
    # File lib/wrest/components/mutators/camel_to_snake_case.rb, line 17
17:       def do_mutate(tuple)
18:         [tuple.first.underscore, tuple.last]
19:       end