lib/rack/app/middlewares/params/definition.rb in rack-app-6.6.0 vs lib/rack/app/middlewares/params/definition.rb in rack-app-6.7.0
- old
+ new
@@ -1,22 +1,21 @@
class Rack::App::Middlewares::Params::Definition
+ require 'rack/app/middlewares/params/definition/options'
- require "rack/app/middlewares/params/definition/options"
-
def initialize(&descriptor)
@required = {}
@optional = {}
instance_exec(&descriptor)
end
- def required(params_key,options)
- @required[params_key.to_s]= self.class::Options.new(options).formatted
+ def required(params_key, options)
+ @required[params_key.to_s] = self.class::Options.new(options).formatted
end
- def optional(params_key,options)
- @optional[params_key.to_s]= self.class::Options.new(options).formatted
+ def optional(params_key, options)
+ @optional[params_key.to_s] = self.class::Options.new(options).formatted
end
def to_descriptor
- {:required => @required, :optional => @optional}
+ { :required => @required, :optional => @optional }
end
end