Skip to content

Shorthand for manual normalization #62

Description

@AlexeyMK

A quick little method I wrote for myself to be able to manually trigger a test.

Usage

AttributeNormalizer.normalize(:phone, "555-123-5123 ")
> 5551235123

Implementation

module AttributeNormalizer
  def self.normalize(normalizer_sym, value)
    configuration.normalizers[normalizer_sym].normalize(value)
  end
end

May be worth adding a slightly more robust method to the library itself.

Thanks for the good work, @mdeering!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions