Class: Webspicy::Web::Openapi::DataStruct
- Inherits:
-
Object
- Object
- Webspicy::Web::Openapi::DataStruct
- Defined in:
- lib/webspicy/web/openapi/data_struct.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #ensure_path(path) ⇒ Object
- #ensure_tags(tags) ⇒ Object
-
#initialize ⇒ DataStruct
constructor
A new instance of DataStruct.
- #to_openapi_data ⇒ Object
Constructor Details
#initialize ⇒ DataStruct
Returns a new instance of DataStruct.
10 11 12 13 14 |
# File 'lib/webspicy/web/openapi/data_struct.rb', line 10 def initialize @info = {} @tags = [] @paths = {} end |
Instance Attribute Details
#info ⇒ Object (readonly)
Returns the value of attribute info.
15 16 17 |
# File 'lib/webspicy/web/openapi/data_struct.rb', line 15 def info @info end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
15 16 17 |
# File 'lib/webspicy/web/openapi/data_struct.rb', line 15 def paths @paths end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
15 16 17 |
# File 'lib/webspicy/web/openapi/data_struct.rb', line 15 def @tags end |
Instance Method Details
#ensure_path(path) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/webspicy/web/openapi/data_struct.rb', line 21 def ensure_path(path) @paths = MERGER.deep_merge( @paths, path, ) end |
#ensure_tags(tags) ⇒ Object
17 18 19 |
# File 'lib/webspicy/web/openapi/data_struct.rb', line 17 def () @tags = (@tags + ).uniq end |
#to_openapi_data ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/webspicy/web/openapi/data_struct.rb', line 28 def to_openapi_data { "openapi" => '3.0.2', "info" => info, "tags" => , "paths" => paths, } end |