Class: Sinatra::SwaggerExposer::Processing::SwaggerTypeValueProcessor
- Inherits:
-
SwaggerBaseValueProcessor
- Object
- SwaggerBaseValueProcessor
- Sinatra::SwaggerExposer::Processing::SwaggerTypeValueProcessor
- Defined in:
- lib/sinatra/swagger-exposer/processing/swagger-type-value-processor.rb
Overview
A processor for a type parameter
Constant Summary
Constants included from SwaggerParameterHelper
SwaggerParameterHelper::HOW_TO_PASS, SwaggerParameterHelper::HOW_TO_PASS_BODY, SwaggerParameterHelper::HOW_TO_PASS_HEADER, SwaggerParameterHelper::HOW_TO_PASS_PATH, SwaggerParameterHelper::HOW_TO_PASS_QUERY, SwaggerParameterHelper::PARAMS_DEFAULT, SwaggerParameterHelper::PARAMS_EXAMPLE, SwaggerParameterHelper::PARAMS_EXCLUSIVE_MAXIMUM, SwaggerParameterHelper::PARAMS_EXCLUSIVE_MINIMUM, SwaggerParameterHelper::PARAMS_FORMAT, SwaggerParameterHelper::PARAMS_LIST, SwaggerParameterHelper::PARAMS_MAXIMUM, SwaggerParameterHelper::PARAMS_MAX_LENGTH, SwaggerParameterHelper::PARAMS_MINIMUM, SwaggerParameterHelper::PARAMS_MIN_LENGTH, SwaggerParameterHelper::PRIMITIVE_TYPES, SwaggerParameterHelper::PRIMITIVE_TYPES_FOR_NON_BODY, SwaggerParameterHelper::TYPE_ARRAY, SwaggerParameterHelper::TYPE_BOOLEAN, SwaggerParameterHelper::TYPE_BYTE, SwaggerParameterHelper::TYPE_DATE, SwaggerParameterHelper::TYPE_DATE_TIME, SwaggerParameterHelper::TYPE_DOUBLE, SwaggerParameterHelper::TYPE_FILE, SwaggerParameterHelper::TYPE_FLOAT, SwaggerParameterHelper::TYPE_INTEGER, SwaggerParameterHelper::TYPE_LONG, SwaggerParameterHelper::TYPE_NUMBER, SwaggerParameterHelper::TYPE_PASSWORD, SwaggerParameterHelper::TYPE_STRING
Instance Attribute Summary collapse
-
#attributes_processors ⇒ Object
readonly
Returns the value of attribute attributes_processors.
Attributes inherited from SwaggerBaseValueProcessor
Instance Method Summary collapse
-
#initialize(name, required, attributes_processors) ⇒ SwaggerTypeValueProcessor
constructor
Initialize.
- #useful? ⇒ Boolean
- #validate_value(value) ⇒ Object
Methods inherited from SwaggerBaseValueProcessor
Constructor Details
#initialize(name, required, attributes_processors) ⇒ SwaggerTypeValueProcessor
Initialize
18 19 20 21 |
# File 'lib/sinatra/swagger-exposer/processing/swagger-type-value-processor.rb', line 18 def initialize(name, required, attributes_processors) super(name, required, nil) @attributes_processors = attributes_processors end |
Instance Attribute Details
#attributes_processors ⇒ Object (readonly)
Returns the value of attribute attributes_processors.
12 13 14 |
# File 'lib/sinatra/swagger-exposer/processing/swagger-type-value-processor.rb', line 12 def attributes_processors @attributes_processors end |
Instance Method Details
#useful? ⇒ Boolean
23 24 25 |
# File 'lib/sinatra/swagger-exposer/processing/swagger-type-value-processor.rb', line 23 def useful? super || (!(@attributes_processors.empty?)) end |
#validate_value(value) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/sinatra/swagger-exposer/processing/swagger-type-value-processor.rb', line 27 def validate_value(value) @attributes_processors.each do |attribute_processor| attribute_processor.process(value) end value end |