ensl.org/lib/verification.rb
Christopher Blanchard 0bf9d7fc7c Remove unusued methods
2015-06-12 00:11:04 +01:00

22 lines
No EOL
489 B
Ruby

module Verification
def Verification.uncrap str
str.to_s.gsub(/[^A-Za-z0-9_\-]/, "")
end
def Verification.random_string len
chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
str = ""
1.upto(len) do |i|
str << chars[rand(chars.size-1)]
end
return str
end
# TODO: rikki?
def Verification.contain params, filter
(params.instance_of?(Array) ? params : params.keys).each do |key|
return false unless filter.include? key.to_sym
end
return true
end
end