Class: Rack::App::Middlewares::Params::Definition::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/app/middlewares/params/definition/options.rb

Constant Summary collapse

ERROR_EACH =
'class must implement #each method to use :of expression in parameter definition'

Instance Method Summary collapse

Constructor Details

#initialize(descriptor) ⇒ Options

Returns a new instance of Options.



5
6
7
# File 'lib/rack/app/middlewares/params/definition/options.rb', line 5

def initialize(descriptor)
  @descriptor = descriptor
end

Instance Method Details

#formattedObject



9
10
11
12
13
14
15
16
# File 'lib/rack/app/middlewares/params/definition/options.rb', line 9

def formatted
  {
    :class => parameter_class,
    :of => parameter_class_elements,
    :description => parameter_description,
    :example => parameter_example
  }
end