Class: Jsapi::Meta::Example::Base
- Inherits:
-
Model::Base
- Object
- Model::Base
- Jsapi::Meta::Example::Base
- Includes:
- OpenAPI::Extensions
- Defined in:
- lib/jsapi/meta/example/base.rb
Overview
Specifies an example.
Constant Summary
Constants included from Model::Attributes
Model::Attributes::DEFAULT_ARRAY, Model::Attributes::DEFAULT_HASH
Instance Method Summary collapse
-
#description ⇒ Object
:attr: description The description of the example.
-
#external ⇒ Object
:attr: external If true,
valueis interpreted as a URI pointing to an external sample value. -
#summary ⇒ Object
:attr: summary The summary of the example.
-
#to_openapi ⇒ Object
Returns a hash representing the OpenAPI example object.
-
#value ⇒ Object
:attr: value The sample value.
Methods included from OpenAPI::Extensions
Methods inherited from Model::Base
#initialize, #inspect, #merge!, #reference?, #resolve
Methods included from Model::Attributes
Constructor Details
This class inherits a constructor from Jsapi::Meta::Model::Base
Instance Method Details
#description ⇒ Object
:attr: description The description of the example.
13 |
# File 'lib/jsapi/meta/example/base.rb', line 13 attribute :description, String |
#external ⇒ Object
:attr: external If true, value is interpreted as a URI pointing to an external sample value.
18 |
# File 'lib/jsapi/meta/example/base.rb', line 18 attribute :external, values: [true, false] |
#summary ⇒ Object
:attr: summary The summary of the example.
23 |
# File 'lib/jsapi/meta/example/base.rb', line 23 attribute :summary, String |
#to_openapi ⇒ Object
Returns a hash representing the OpenAPI example object.
31 32 33 34 35 36 37 |
# File 'lib/jsapi/meta/example/base.rb', line 31 def to_openapi(*) with_openapi_extensions( { summary: summary, description: description }.tap do |result| result[external? ? :externalValue : :value] = value end ) end |
#value ⇒ Object
:attr: value The sample value.
28 |
# File 'lib/jsapi/meta/example/base.rb', line 28 attribute :value |