Created
November 9, 2018 05:57
-
-
Save anamba/22de14a570d8b7a4cf700eea16fd515b to your computer and use it in GitHub Desktop.
added Amber::Validators::Params#to_unsafe_h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Amber::Validators | |
class Params | |
def to_unsafe_h | |
unsafe_params = {} of String => String? | |
@rules.each do |rule| | |
rule.apply(raw_params) | |
unsafe_params[rule.field] = rule.value | |
end | |
unsafe_params | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment