class Apipie::Params::Descriptor::Regexp
validate arguments value with regular expression
Public Class Methods
build(regexp, options, block)
click to toggle source
# File lib/apipie/params/descriptor.rb, line 129 def self.build(regexp, options, block) self.new(regexp, options) if regexp.is_a? ::Regexp end
new(regexp, options)
click to toggle source
Calls superclass method
Apipie::Params::Descriptor::Base::new
# File lib/apipie/params/descriptor.rb, line 133 def initialize(regexp, options) super(options) @regexp = regexp end
Public Instance Methods
description()
click to toggle source
# File lib/apipie/params/descriptor.rb, line 138 def description "Must match regular expression /#{@regexp.source}/." end
json_schema()
click to toggle source
Calls superclass method
Apipie::Params::Descriptor::JsonSchema#json_schema
# File lib/apipie/params/descriptor.rb, line 142 def json_schema super.merge('type' => 'string', 'pattern' => @regexp.source) end