class RatPackSwagger::RequestValidatorCollection
Public Class Methods
new()
click to toggle source
# File lib/request_validators.rb, line 6 def initialize @validators = {} end
Public Instance Methods
get(path, verb, type = nil)
click to toggle source
# File lib/request_validators.rb, line 10 def get(path, verb, type = nil) if @validators[path] if @validators[path][verb] if type if @validators[path][verb][type] return @validators[path][verb][type] end else return @validators[path][verb] end end end return nil end
set(path, verb, type, validator)
click to toggle source
# File lib/request_validators.rb, line 25 def set(path, verb, type, validator) @validators[path] ||= {} @validators[path][verb] ||= {} @validators[path][verb][type] = validator end