Sha256: c822d356ea741c0e1eae457a87f72eb1a5fc0a50972572464d1afcdb5ab737cf

Contents?: true

Size: 533 Bytes

Versions: 33

Compression:

Stored size: 533 Bytes

Contents

class Rack::App::Middlewares::Params::Definition

  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
  end

  def optional(params_key,options)
    @optional[params_key.to_s]= self.class::Options.new(options).formatted
  end

  def to_descriptor
    {:required => @required, :optional => @optional}
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
rack-app-6.6.0 lib/rack/app/middlewares/params/definition.rb
rack-app-6.5.0 lib/rack/app/middlewares/params/definition.rb
rack-app-6.4.1 lib/rack/app/middlewares/params/definition.rb
rack-app-6.4.0 lib/rack/app/middlewares/params/definition.rb
rack-app-6.3.3 lib/rack/app/middlewares/params/definition.rb
rack-app-6.3.2 lib/rack/app/middlewares/params/definition.rb
rack-app-6.3.1 lib/rack/app/middlewares/params/definition.rb
rack-app-6.3.0 lib/rack/app/middlewares/params/definition.rb
rack-app-6.2.0 lib/rack/app/middlewares/params/definition.rb
rack-app-6.1.0 lib/rack/app/middlewares/params/definition.rb
rack-app-6.0.0 lib/rack/app/middlewares/params/definition.rb
rack-app-5.12.0 lib/rack/app/middlewares/params/definition.rb
rack-app-5.11.1 lib/rack/app/middlewares/params/definition.rb
rack-app-5.11.0 lib/rack/app/middlewares/params/definition.rb
rack-app-5.10.2 lib/rack/app/middlewares/params/definition.rb
rack-app-5.10.1 lib/rack/app/middlewares/params/definition.rb
rack-app-5.10.0 lib/rack/app/middlewares/params/definition.rb
rack-app-5.9.0 lib/rack/app/middlewares/params/definition.rb
rack-app-5.8.0 lib/rack/app/middlewares/params/definition.rb
rack-app-5.7.0 lib/rack/app/middlewares/params/definition.rb