Class: OpenApi::DSL::ParamObj
- Inherits:
-
Hash
- Object
- Hash
- OpenApi::DSL::ParamObj
- Includes:
- Helpers
- Defined in:
- lib/oas_objs/param_obj.rb
Instance Attribute Summary collapse
-
#processed ⇒ Object
Returns the value of attribute processed.
-
#schema ⇒ Object
Returns the value of attribute schema.
Instance Method Summary collapse
-
#initialize(name, param_type, type, required, schema) ⇒ ParamObj
constructor
A new instance of ParamObj.
- #name ⇒ Object
- #process ⇒ Object
Methods included from Helpers
#_combined_schema, #arrow_writing_support, #process_schema_input
Constructor Details
#initialize(name, param_type, type, required, schema) ⇒ ParamObj
Returns a new instance of ParamObj.
13 14 15 16 17 18 19 20 |
# File 'lib/oas_objs/param_obj.rb', line 13 def initialize(name, param_type, type, required, schema) self.processed = { name: name.to_s.delete('!').to_sym, in: param_type.to_s.delete('!'), required: required.to_s[/req/].present? } merge!(self.schema = schema) end |
Instance Attribute Details
#processed ⇒ Object
Returns the value of attribute processed.
11 12 13 |
# File 'lib/oas_objs/param_obj.rb', line 11 def processed @processed end |
#schema ⇒ Object
Returns the value of attribute schema.
11 12 13 |
# File 'lib/oas_objs/param_obj.rb', line 11 def schema @schema end |
Instance Method Details
#name ⇒ Object
29 30 31 |
# File 'lib/oas_objs/param_obj.rb', line 29 def name processed[:name] end |
#process ⇒ Object
22 23 24 25 26 27 |
# File 'lib/oas_objs/param_obj.rb', line 22 def process processed[:schema] = schema.process desc = schema.processed[:description] processed[:description] = desc if desc processed end |