Class: Mountapi::OpenApi::Document
- Inherits:
-
Object
- Object
- Mountapi::OpenApi::Document
- Defined in:
- lib/mountapi/open_api/document.rb
Instance Attribute Summary collapse
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
-
#initialize(string) ⇒ Document
constructor
A new instance of Document.
- #routes ⇒ Object
Constructor Details
#initialize(string) ⇒ Document
Returns a new instance of Document.
9 10 11 |
# File 'lib/mountapi/open_api/document.rb', line 9 def initialize(string) @spec = Openapi3Parser.load(string) end |
Instance Attribute Details
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
7 8 9 |
# File 'lib/mountapi/open_api/document.rb', line 7 def spec @spec end |
Instance Method Details
#routes ⇒ Object
13 14 15 16 17 |
# File 'lib/mountapi/open_api/document.rb', line 13 def routes spec.paths.inject([]) do |acc, path| acc.concat(Path.new(*path, version).to_routes) end end |