Skip to content

Instantly share code, notes, and snippets.

@studio3104
Created December 4, 2014 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save studio3104/bed969d854cdc8ad8294 to your computer and use it in GitHub Desktop.
Save studio3104/bed969d854cdc8ad8294 to your computer and use it in GitHub Desktop.
params = { v1: '10', v2: '' }
rule1 = Focuslight::Validator.rule(:int)
rule2 = Focuslight::Validator.rule(:not_blank)
result = Focuslight::Validator.validate(
params,
v1: { rule: [ rule1, rule2 ] },
v2: { rule: [ rule1, rule2 ] },
)
ap result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment