Class: OasContrib::OpenAPI::V3::Spec
- Defined in:
- lib/oas_contrib/openapi/v3/spec.rb
Overview
Spec class
Instance Attribute Summary collapse
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(data) ⇒ Spec
constructor
Initialize.
-
#mapping ⇒ OpenAPI::V3::Spec
Mapping the hash to the spec object.
Constructor Details
#initialize(data) ⇒ Spec
Initialize
23 24 25 |
# File 'lib/oas_contrib/openapi/v3/spec.rb', line 23 def initialize(data) super end |
Instance Attribute Details
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
11 12 13 |
# File 'lib/oas_contrib/openapi/v3/spec.rb', line 11 def @meta end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
19 20 21 |
# File 'lib/oas_contrib/openapi/v3/spec.rb', line 19 def model @model end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
15 16 17 |
# File 'lib/oas_contrib/openapi/v3/spec.rb', line 15 def path @path end |
Instance Method Details
#mapping ⇒ OpenAPI::V3::Spec
Mapping the hash to the spec object.
29 30 31 32 33 34 |
# File 'lib/oas_contrib/openapi/v3/spec.rb', line 29 def mapping @meta = data.select { |v| v != 'paths' && v != 'components' } || nil @path = data['paths'] || nil @model = data.dig('components', 'schemas') || nil self end |