Class: WeakSwaggerParameters::Definitions::Property
- Inherits:
-
Object
- Object
- WeakSwaggerParameters::Definitions::Property
- Includes:
- LeafDefinition
- Defined in:
- lib/weak_swagger_parameters/definitions/property.rb
Instance Method Summary collapse
- #apply_docs(parent_node) ⇒ Object
-
#initialize(type, name, description, options = {}) ⇒ Property
constructor
A new instance of Property.
Methods included from LeafDefinition
Constructor Details
#initialize(type, name, description, options = {}) ⇒ Property
Returns a new instance of Property.
8 9 10 |
# File 'lib/weak_swagger_parameters/definitions/property.rb', line 8 def initialize(type, name, description, = {}) @options = .merge(name: name, type: type, description: description) end |
Instance Method Details
#apply_docs(parent_node) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/weak_swagger_parameters/definitions/property.rb', line 12 def apply_docs(parent_node) name = @options[:name] = WeakSwaggerParameters::Services::SwaggerOptionsAdapter.adapt(@options.except(:name, :required)) parent_node.instance_eval { property name, } end |